/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('aicontent', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AliyunConsoleServiceInfoDTO {
  buyUrl?: string(name='buyUrl', example='https://www.aliyun.com/product/ai-algorithm'),
  documentUrl?: string(name='documentUrl', example='https://www.aliyun.com/product/ai-algorithm'),
  freeConcurrencyCount?: int32(name='freeConcurrencyCount', example='10'),
  freeCount?: int32(name='freeCount', example='100'),
  serviceCode?: string(name='serviceCode', example='online_ai_algorithm_personalized_text_to_image_call_count'),
  serviceName?: string(name='serviceName', example='AI算法模型-个性化文生图-在线按量调用'),
}

model OpenApiMultiResponse {
  data?: [ 
    {
      createTime?: string(name='createTime'),
      id?: string(name='id', example='456'),
      imageUrl?: [ string ](name='imageUrl'),
      inferenceImageCount?: int32(name='inferenceImageCount'),
      inferenceJobList?: [ 
        {
          createTime?: string(name='createTime', example='2023-12-25T12:00:00'),
          id?: string(name='id', example='3220'),
          jobStatus?: string(name='jobStatus', example='FINISHED'),
          jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
          modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
          promptId?: string(name='promptId', example='promptId-xxxx-xxxx-xxxx'),
          resultImageUrl?: [ string ](name='resultImageUrl', example='0000.png'),
        }
      ](name='inferenceJobList'),
      jobStatus?: string(name='jobStatus', example='TRAINING'),
      jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
      modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
      name?: string(name='name', example='可爱熊猫模型训练任务'),
      objectType?: string(name='objectType', example='panda'),
    }
  ](name='data', example='[]'),
  errCode?: string(name='errCode'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
}

model OpenApiSingleResponse {
  data?: {
    modelTrainStatus?: string(name='modelTrainStatus', example='FINISHED'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
}

model Personalizedtxt2imgAddInferenceJobCmd {
  imageNumber?: int32(name='imageNumber', example='1'),
  modelId?: string(name='modelId', description='This parameter is required.', example='xxxx-xxxx-xxxx'),
  prompt?: string(name='prompt', description='This parameter is required.', example='a <special-token> in the snow'),
  seed?: int32(name='seed', example='1'),
}

model Personalizedtxt2imgAddModelTrainJobCmd {
  imageUrl?: [ string ](name='imageUrl', description='This parameter is required.'),
  name?: string(name='name', description='This parameter is required.', example='熊猫图片生成'),
  objectType?: string(name='objectType', description='This parameter is required.', example='dog'),
}

model Personalizedtxt2imgInferenceJobInfoDTO {
  createUserId?: string(name='createUserId', example='123456'),
  id?: string(name='id', example='123456'),
  jobStatus?: string(name='jobStatus', example='123456'),
  modelId?: string(name='modelId', example='123456'),
  resultImageUrl?: [ string ](name='resultImageUrl', example='123456'),
}

model Personalizedtxt2imgModelTrainJobInfoDTO {
  createTime?: string(name='CreateTime'),
  createUserId?: string(name='CreateUserId'),
  imageUrl?: [ string ](name='ImageUrl'),
  inferenceJobList?: [
    Personalizedtxt2imgInferenceJobInfoDTO
  ](name='InferenceJobList'),
  jobStatus?: string(name='JobStatus'),
  name?: string(name='Name'),
  objectType?: string(name='ObjectType'),
  id?: string(name='id', example='123456'),
}

model AITeacherExpansionPracticeTaskGenerateRequest {
  grade?: string(name='grade', description='This parameter is required.', example='13'),
  keySentences?: [ string ](name='keySentences'),
  keyWords?: [ string ](name='keyWords'),
  learningObject?: string(name='learningObject', example='Understanding unique professions such as dog walkers, hotel test sleepers, and food tasters, including their job responsibilities and the benefits or challenges associated with each role.'),
  textContent?: string(name='textContent', description='This parameter is required.', example='Dog walker Dog walking, as a profession, originated in the US. Some may think that it\\\\"s a perfect job, because dog walkers won\\\\"t be imprisoned in an office. But it\\\\"s actually manual labour. At their busiest, dog walkers may have more than ten dogs to take care of in a day. Hotel test sleeper A hotel test sleeper, as the name suggests, has to write expert reviews about the facilities, locations, prices, dining and other services of hotels, in order to provide evaluations and guides for travelers. Hotel test sleepers don\\\\"t need to punch in for work and they get about ten thousand yuan as income every month. What a comfortable job! Food taster In ancient times, a food taster was a person who tasted foods (or drinks) to be served to someone else, to confirm that it was safe to eat. But now, those working as food tasters just get to taste various new foods and drinks aimed at specific regions across the world. They then give their opinions on these products to the companies and suggest improvements.'),
  textbook?: string(name='textbook'),
  topic?: string(name='topic', description='This parameter is required.', example='talk about your dream job.'),
  userId?: string(name='userId', description='This parameter is required.', example='6440xxxxxxxxxx5fafc98c421'),
}

model AITeacherExpansionPracticeTaskGenerateResponseBody = {
  data?: {
    backgroundDescription?: string(name='backgroundDescription', example='In a career counseling session, we are going to discuss our dream jobs and the responsibilities associated with them. Alex, who dreams of becoming a professional travel blogger, will share the tasks and skills required for this role, while Jamie, aspiring to be a wildlife photographer, will outline the responsibilities and challenges of capturing nature\\\\"s moments. Both will explore how their interests align with the practical aspects of their chosen careers, discussing the potential for travel, creativity, and the impact of their work on society and the environment.'),
    roleSet?: {
      assistant?: string(name='assistant', example='Alex'),
      user?: string(name='user', example='Jamie'),
    }(name='roleSet'),
    startSentence?: string(name='startSentence', example='Hey Jamie, do you know what a travel blogger does?'),
    taskContent?: [ 
      {
        assistant?: string(name='assistant', example='Why might some people think dog walking is a great job?'),
        user?: string(name='user', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
      }
    ](name='taskContent'),
    taskType?: string(name='taskType', example='textbook_dialogue'),
  }(name='data'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model AITeacherExpansionPracticeTaskGenerateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AITeacherExpansionPracticeTaskGenerateResponseBody(name='body'),
}

/**
 * @summary 拓展练问答对生成
 *
 * @param request AITeacherExpansionPracticeTaskGenerateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AITeacherExpansionPracticeTaskGenerateResponse
 */
async function aITeacherExpansionPracticeTaskGenerateWithOptions(request: AITeacherExpansionPracticeTaskGenerateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AITeacherExpansionPracticeTaskGenerateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.grade)) {
    body['grade'] = request.grade;
  }
  if (!Util.isUnset(request.keySentences)) {
    body['keySentences'] = request.keySentences;
  }
  if (!Util.isUnset(request.keyWords)) {
    body['keyWords'] = request.keyWords;
  }
  if (!Util.isUnset(request.learningObject)) {
    body['learningObject'] = request.learningObject;
  }
  if (!Util.isUnset(request.textContent)) {
    body['textContent'] = request.textContent;
  }
  if (!Util.isUnset(request.textbook)) {
    body['textbook'] = request.textbook;
  }
  if (!Util.isUnset(request.topic)) {
    body['topic'] = request.topic;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AITeacherExpansionPracticeTaskGenerate',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/expansionPractice/generateTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 拓展练问答对生成
 *
 * @param request AITeacherExpansionPracticeTaskGenerateRequest
 * @return AITeacherExpansionPracticeTaskGenerateResponse
 */
async function aITeacherExpansionPracticeTaskGenerate(request: AITeacherExpansionPracticeTaskGenerateRequest): AITeacherExpansionPracticeTaskGenerateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return aITeacherExpansionPracticeTaskGenerateWithOptions(request, headers, runtime);
}

model AITeacherSyncPracticeTaskGenerateRequest {
  grade?: string(name='grade', description='This parameter is required.', example='13'),
  keySentences?: [ string ](name='keySentences'),
  keyWords?: [ string ](name='keyWords'),
  learningObject?: string(name='learningObject', example='Understanding unique professions such as dog walkers, hotel test sleepers, and food tasters, including their job responsibilities and the benefits or challenges associated with each role.'),
  textContent?: string(name='textContent', description='This parameter is required.', example='Dog walker Dog walking, as a profession, originated in the US. Some may think that it\\\\"s a perfect job, because dog walkers won\\\\"t be imprisoned in an office. But it\\\\"s actually manual labour. At their busiest, dog walkers may have more than ten dogs to take care of in a day. Hotel test sleeper A hotel test sleeper, as the name suggests, has to write expert reviews about the facilities, locations, prices, dining and other services of hotels, in order to provide evaluations and guides for travelers. Hotel test sleepers don\\\\"t need to punch in for work and they get about ten thousand yuan as income every month. What a comfortable job! Food taster In ancient times, a food taster was a person who tasted foods (or drinks) to be served to someone else, to confirm that it was safe to eat. But now, those working as food tasters just get to taste various new foods and drinks aimed at specific regions across the world. They then give their opinions on these products to the companies and suggest improvements.'),
  textbook?: string(name='textbook'),
  topic?: string(name='topic', description='This parameter is required.', example='talk about your dream job.'),
  userId?: string(name='userId', description='This parameter is required.', example='6440xxxxxxxxxx5fafc98c421'),
}

model AITeacherSyncPracticeTaskGenerateResponseBody = {
  data?: {
    taskContent?: [ 
      {
        assistant?: string(name='assistant', example='Why might some people think dog walking is a great job?'),
        user?: string(name='user', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
      }
    ](name='taskContent'),
    taskType?: string(name='taskType', example='textbook_question_answering'),
  }(name='data'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model AITeacherSyncPracticeTaskGenerateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AITeacherSyncPracticeTaskGenerateResponseBody(name='body'),
}

/**
 * @summary 同步基础练问答对生成
 *
 * @param request AITeacherSyncPracticeTaskGenerateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AITeacherSyncPracticeTaskGenerateResponse
 */
async function aITeacherSyncPracticeTaskGenerateWithOptions(request: AITeacherSyncPracticeTaskGenerateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AITeacherSyncPracticeTaskGenerateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.grade)) {
    body['grade'] = request.grade;
  }
  if (!Util.isUnset(request.keySentences)) {
    body['keySentences'] = request.keySentences;
  }
  if (!Util.isUnset(request.keyWords)) {
    body['keyWords'] = request.keyWords;
  }
  if (!Util.isUnset(request.learningObject)) {
    body['learningObject'] = request.learningObject;
  }
  if (!Util.isUnset(request.textContent)) {
    body['textContent'] = request.textContent;
  }
  if (!Util.isUnset(request.textbook)) {
    body['textbook'] = request.textbook;
  }
  if (!Util.isUnset(request.topic)) {
    body['topic'] = request.topic;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AITeacherSyncPracticeTaskGenerate',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/syncPractice/generateTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 同步基础练问答对生成
 *
 * @param request AITeacherSyncPracticeTaskGenerateRequest
 * @return AITeacherSyncPracticeTaskGenerateResponse
 */
async function aITeacherSyncPracticeTaskGenerate(request: AITeacherSyncPracticeTaskGenerateRequest): AITeacherSyncPracticeTaskGenerateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return aITeacherSyncPracticeTaskGenerateWithOptions(request, headers, runtime);
}

model AliyunConsoleOpenApiQueryAliyunConsoleServcieListResponseBody = {
  data?: [ 
    {
      freeConcurrencyCount?: int32(name='FreeConcurrencyCount', example='10'),
      freeCount?: int32(name='FreeCount', example='100'),
      serviceCode?: string(name='ServiceCode', example='online_ai_algorithm_personalized_text_to_image_call_count'),
      serviceName?: string(name='ServiceName', example='AI算法模型-个性化文生图-在线按量调用'),
    }
  ](name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model AliyunConsoleOpenApiQueryAliyunConsoleServcieListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AliyunConsoleOpenApiQueryAliyunConsoleServcieListResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/列出阿里云控制台上可使用的服务列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AliyunConsoleOpenApiQueryAliyunConsoleServcieListResponse
 */
async function aliyunConsoleOpenApiQueryAliyunConsoleServcieListWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): AliyunConsoleOpenApiQueryAliyunConsoleServcieListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'AliyunConsoleOpenApiQueryAliyunConsoleServcieList',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunconsole/queryAliyunConsoleServcieList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/列出阿里云控制台上可使用的服务列表
 *
 * @return AliyunConsoleOpenApiQueryAliyunConsoleServcieListResponse
 */
async function aliyunConsoleOpenApiQueryAliyunConsoleServcieList(): AliyunConsoleOpenApiQueryAliyunConsoleServcieListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return aliyunConsoleOpenApiQueryAliyunConsoleServcieListWithOptions(headers, runtime);
}

model AliyunConsoleOpenApiQueryAliyunConsoleServiceListResponseBody = {
  data?: [
    AliyunConsoleServiceInfoDTO
  ](name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model AliyunConsoleOpenApiQueryAliyunConsoleServiceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AliyunConsoleOpenApiQueryAliyunConsoleServiceListResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/列出阿里云控制台上可使用的服务列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AliyunConsoleOpenApiQueryAliyunConsoleServiceListResponse
 */
async function aliyunConsoleOpenApiQueryAliyunConsoleServiceListWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): AliyunConsoleOpenApiQueryAliyunConsoleServiceListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'AliyunConsoleOpenApiQueryAliyunConsoleServiceList',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/queryAliyunConsoleServiceList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/列出阿里云控制台上可使用的服务列表
 *
 * @return AliyunConsoleOpenApiQueryAliyunConsoleServiceListResponse
 */
async function aliyunConsoleOpenApiQueryAliyunConsoleServiceList(): AliyunConsoleOpenApiQueryAliyunConsoleServiceListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return aliyunConsoleOpenApiQueryAliyunConsoleServiceListWithOptions(headers, runtime);
}

model CreateAccessWarrantRequest {
  appId?: string(name='appId', example='a123'),
  requestSign?: string(name='requestSign', example='e32fac43df0b0b0be32fac43df0b0b0b'),
  timestamp?: string(name='timestamp', example='1701000000'),
  userClientIp?: string(name='userClientIp', example='110.25.23.12'),
  userId?: string(name='userId', example='sn123'),
  warrantAvailable?: int32(name='warrantAvailable', example='7200'),
}

model CreateAccessWarrantResponseBody = {
  data?: {
    accessToken?: string(name='AccessToken', example='1234567890'),
    accessWarrantId?: string(name='AccessWarrantId', example='ex2xxxxxxxx'),
    applicationAccessId?: string(name='ApplicationAccessId', example='1234567890'),
    createTime?: string(name='CreateTime', example='1672531200'),
    expireTime?: string(name='ExpireTime', example='1672531200'),
    userId?: string(name='UserId', example='1234567890'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model CreateAccessWarrantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAccessWarrantResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/授权凭证创建
 *
 * @param request CreateAccessWarrantRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAccessWarrantResponse
 */
async function createAccessWarrantWithOptions(request: CreateAccessWarrantRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateAccessWarrantResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['appId'] = request.appId;
  }
  if (!Util.isUnset(request.requestSign)) {
    body['requestSign'] = request.requestSign;
  }
  if (!Util.isUnset(request.timestamp)) {
    body['timestamp'] = request.timestamp;
  }
  if (!Util.isUnset(request.userClientIp)) {
    body['userClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }
  if (!Util.isUnset(request.warrantAvailable)) {
    body['warrantAvailable'] = request.warrantAvailable;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccessWarrant',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/createAccessWarrant`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/授权凭证创建
 *
 * @param request CreateAccessWarrantRequest
 * @return CreateAccessWarrantResponse
 */
async function createAccessWarrant(request: CreateAccessWarrantRequest): CreateAccessWarrantResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createAccessWarrantWithOptions(request, headers, runtime);
}

model CreateProjectRequest {
  projectName?: string(name='projectName', example='MyProject'),
  projectType?: string(name='projectType', example='online_oral_evaluation_post_paid_call_count'),
}

model CreateProjectResponseBody = {
  data?: {
    createTime?: string(name='CreateTime', example='2023-02-15T09:17:39Z'),
    projectApps?: [ 
      {
        applicationAccessIds?: [ 
          {
            applicationAccessId?: string(name='applicationAccessId', example='1234567890'),
            applicationAccessSecret?: string(name='applicationAccessSecret', example='MyAppSecret'),
          }
        ](name='ApplicationAccessIds'),
        id?: string(name='Id', example='4867'),
        projectId?: string(name='ProjectId', example='4910'),
      }
    ](name='ProjectApps'),
    projectId?: string(name='ProjectId', example='124187'),
    projectName?: string(name='ProjectName', example='MyProject'),
    projectSDK?: [ 
      {
        createTime?: string(name='CreateTime', example='2023-02-15T09:17:39Z'),
        demoUrl?: string(name='DemoUrl', example='http://demo.com/demo'),
        deployMode?: string(name='DeployMode'),
        developLanguage?: string(name='DevelopLanguage', example='C++'),
        docUrl?: string(name='DocUrl', example='http://demo.com/doc'),
        sdkName?: string(name='SdkName', example='C SDK'),
        sdkUrl?: string(name='SdkUrl', example='http://demo.com/sdk.zip'),
        sdkVersion?: string(name='SdkVersion', example='4.12.8'),
      }
    ](name='ProjectSDK'),
    projectType?: string(name='ProjectType', example='WebApplication'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model CreateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/创建项目
 *
 * @param request CreateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectResponse
 */
async function createProjectWithOptions(request: CreateProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.projectName)) {
    body['projectName'] = request.projectName;
  }
  if (!Util.isUnset(request.projectType)) {
    body['projectType'] = request.projectType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProject',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/createProject`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/创建项目
 *
 * @param request CreateProjectRequest
 * @return CreateProjectResponse
 */
async function createProject(request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectWithOptions(request, headers, runtime);
}

model ExecuteAITeacherChineseCompositionTutoringWorkflowRunHeaders {
  commonHeaders?: map[string]string,
  callerParentId?: long(name='callerParentId', example='xxxxxxx'),
  callerType?: string(name='callerType', example='sub'),
  callerUid?: long(name='callerUid', example='xxxxxxx'),
  stsTokenCallerUid?: long(name='stsTokenCallerUid', example='xxxxxxx'),
}

model ExecuteAITeacherChineseCompositionTutoringWorkflowRunRequest {
  essayOutline?: string(name='essayOutline'),
  essayRequirements?: string(name='essayRequirements'),
  essayTopic?: string(name='essayTopic'),
  essayType?: string(name='essayType', example='essay'),
  essayWordCount?: long(name='essayWordCount', example='100'),
  grade?: long(name='grade', example='3'),
  responseMode?: string(name='responseMode', example='streaming'),
  userId?: string(name='userId', example='xxxxxxxxx'),
}

model ExecuteAITeacherChineseCompositionTutoringWorkflowRunResponseBody = {
  content?: string(name='content'),
  event?: string(name='event', example='message'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
}

model ExecuteAITeacherChineseCompositionTutoringWorkflowRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherChineseCompositionTutoringWorkflowRunResponseBody(name='body'),
}

/**
 * @summary 中文作文辅导
 *
 * @param request ExecuteAITeacherChineseCompositionTutoringWorkflowRunRequest
 * @param headers ExecuteAITeacherChineseCompositionTutoringWorkflowRunHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherChineseCompositionTutoringWorkflowRunResponse
 */
async function executeAITeacherChineseCompositionTutoringWorkflowRunWithOptions(request: ExecuteAITeacherChineseCompositionTutoringWorkflowRunRequest, headers: ExecuteAITeacherChineseCompositionTutoringWorkflowRunHeaders, runtime: Util.RuntimeOptions): ExecuteAITeacherChineseCompositionTutoringWorkflowRunResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.essayOutline)) {
    body['essayOutline'] = request.essayOutline;
  }
  if (!Util.isUnset(request.essayRequirements)) {
    body['essayRequirements'] = request.essayRequirements;
  }
  if (!Util.isUnset(request.essayTopic)) {
    body['essayTopic'] = request.essayTopic;
  }
  if (!Util.isUnset(request.essayType)) {
    body['essayType'] = request.essayType;
  }
  if (!Util.isUnset(request.essayWordCount)) {
    body['essayWordCount'] = request.essayWordCount;
  }
  if (!Util.isUnset(request.grade)) {
    body['grade'] = request.grade;
  }
  if (!Util.isUnset(request.responseMode)) {
    body['responseMode'] = request.responseMode;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.callerParentId)) {
    realHeaders['callerParentId'] = Util.toJSONString(headers.callerParentId);
  }
  if (!Util.isUnset(headers.callerType)) {
    realHeaders['callerType'] = Util.toJSONString(headers.callerType);
  }
  if (!Util.isUnset(headers.callerUid)) {
    realHeaders['callerUid'] = Util.toJSONString(headers.callerUid);
  }
  if (!Util.isUnset(headers.stsTokenCallerUid)) {
    realHeaders['stsTokenCallerUid'] = Util.toJSONString(headers.stsTokenCallerUid);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherChineseCompositionTutoringWorkflowRun',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/pop/api/v1/intelligentAgent/chineseCompositionTutoring/workflowRun`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 中文作文辅导
 *
 * @param request ExecuteAITeacherChineseCompositionTutoringWorkflowRunRequest
 * @return ExecuteAITeacherChineseCompositionTutoringWorkflowRunResponse
 */
async function executeAITeacherChineseCompositionTutoringWorkflowRun(request: ExecuteAITeacherChineseCompositionTutoringWorkflowRunRequest): ExecuteAITeacherChineseCompositionTutoringWorkflowRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ExecuteAITeacherChineseCompositionTutoringWorkflowRunHeaders{};
  return executeAITeacherChineseCompositionTutoringWorkflowRunWithOptions(request, headers, runtime);
}

model ExecuteAITeacherEnglishCompositionTutoringWorkflowRunRequest {
  essayOutline?: string(name='essayOutline', example='Title: The Importance of Reading
I. Introduction
II. Body
III. Conclusion'),
  essayRequirements?: string(name='essayRequirements', description='This parameter is required.', example='No less than 100 words'),
  essayTopic?: string(name='essayTopic', description='This parameter is required.', example='Discuss what to eat'),
  essayType?: string(name='essayType', example='essay'),
  essayWordCount?: long(name='essayWordCount', example='100'),
  grade?: long(name='grade', description='This parameter is required.', example='3'),
  responseMode?: string(name='responseMode', description='This parameter is required.', example='streaming'),
  userId?: string(name='userId', description='This parameter is required.', example='xxxxxxx'),
}

model ExecuteAITeacherEnglishCompositionTutoringWorkflowRunResponseBody = {
  content?: string(name='content', example='hi'),
  event?: string(name='event', example='message'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
}

model ExecuteAITeacherEnglishCompositionTutoringWorkflowRunResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherEnglishCompositionTutoringWorkflowRunResponseBody(name='body'),
}

/**
 * @summary 英语作文辅导
 *
 * @param request ExecuteAITeacherEnglishCompositionTutoringWorkflowRunRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherEnglishCompositionTutoringWorkflowRunResponse
 */
async function executeAITeacherEnglishCompositionTutoringWorkflowRunWithOptions(request: ExecuteAITeacherEnglishCompositionTutoringWorkflowRunRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherEnglishCompositionTutoringWorkflowRunResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.essayOutline)) {
    body['essayOutline'] = request.essayOutline;
  }
  if (!Util.isUnset(request.essayRequirements)) {
    body['essayRequirements'] = request.essayRequirements;
  }
  if (!Util.isUnset(request.essayTopic)) {
    body['essayTopic'] = request.essayTopic;
  }
  if (!Util.isUnset(request.essayType)) {
    body['essayType'] = request.essayType;
  }
  if (!Util.isUnset(request.essayWordCount)) {
    body['essayWordCount'] = request.essayWordCount;
  }
  if (!Util.isUnset(request.grade)) {
    body['grade'] = request.grade;
  }
  if (!Util.isUnset(request.responseMode)) {
    body['responseMode'] = request.responseMode;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherEnglishCompositionTutoringWorkflowRun',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/pop/api/v1/intelligentAgent/englishCompositionTutoring/workflowRun`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 英语作文辅导
 *
 * @param request ExecuteAITeacherEnglishCompositionTutoringWorkflowRunRequest
 * @return ExecuteAITeacherEnglishCompositionTutoringWorkflowRunResponse
 */
async function executeAITeacherEnglishCompositionTutoringWorkflowRun(request: ExecuteAITeacherEnglishCompositionTutoringWorkflowRunRequest): ExecuteAITeacherEnglishCompositionTutoringWorkflowRunResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherEnglishCompositionTutoringWorkflowRunWithOptions(request, headers, runtime);
}

model ExecuteAITeacherEnglishParaphraseChatMessageRequest {
  chatId?: string(name='chatId', example='6788e0b475a4631ffc626722'),
  content?: string(name='content', example='How much is this?'),
  grade?: long(name='grade', example='3'),
  questionId?: string(name='questionId', example='xxxxxxxxx'),
  questionInfo?: string(name='questionInfo', example='How to inquire about the price'),
  responseMode?: string(name='responseMode', example='sreaming'),
  userAnswer?: string(name='userAnswer', example='How much is this?'),
  userId?: string(name='userId', example='xxxxxxx'),
}

model ExecuteAITeacherEnglishParaphraseChatMessageResponseBody = {
  content?: string(name='content', example='how'),
  event?: string(name='event', example='message'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
}

model ExecuteAITeacherEnglishParaphraseChatMessageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherEnglishParaphraseChatMessageResponseBody(name='body'),
}

/**
 * @summary 英文释义
 *
 * @param request ExecuteAITeacherEnglishParaphraseChatMessageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherEnglishParaphraseChatMessageResponse
 */
async function executeAITeacherEnglishParaphraseChatMessageWithOptions(request: ExecuteAITeacherEnglishParaphraseChatMessageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherEnglishParaphraseChatMessageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.grade)) {
    body['grade'] = request.grade;
  }
  if (!Util.isUnset(request.questionId)) {
    body['questionId'] = request.questionId;
  }
  if (!Util.isUnset(request.questionInfo)) {
    body['questionInfo'] = request.questionInfo;
  }
  if (!Util.isUnset(request.responseMode)) {
    body['responseMode'] = request.responseMode;
  }
  if (!Util.isUnset(request.userAnswer)) {
    body['userAnswer'] = request.userAnswer;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherEnglishParaphraseChatMessage',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/pop/api/v1/intelligentAgent/englishParaphrase/chatMessage`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 英文释义
 *
 * @param request ExecuteAITeacherEnglishParaphraseChatMessageRequest
 * @return ExecuteAITeacherEnglishParaphraseChatMessageResponse
 */
async function executeAITeacherEnglishParaphraseChatMessage(request: ExecuteAITeacherEnglishParaphraseChatMessageRequest): ExecuteAITeacherEnglishParaphraseChatMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherEnglishParaphraseChatMessageWithOptions(request, headers, runtime);
}

model ExecuteAITeacherExpansionDialogueRequest {
  background?: string(name='background', description='This parameter is required.', example='In a career counseling session, we are going to discuss our dream jobs and the responsibilities associated with them. Alex, who dreams of becoming a professional travel blogger, will share the tasks and skills required for this role, while Jamie, aspiring to be a wildlife photographer, will outline the responsibilities and challenges of capturing nature\\\\"s moments. Both will explore how their interests align with the practical aspects of their chosen careers, discussing the potential for travel, creativity, and the impact of their work on society and the environment.'),
  dialogueTasks?: [ 
    {
      assistant?: string(name='assistant', description='This parameter is required.', example='Why might some people think dog walking is a great job?'),
      assistantTranslate?: string(name='assistantTranslate', example='为什么有些人认为遛狗是份好差事?'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      user?: string(name='user', description='This parameter is required.', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
    }
  ](name='dialogueTasks', description='This parameter is required.'),
  languageCode?: string(name='languageCode', example='en-gb'),
  records?: [ 
    {
      content?: string(name='content', description='This parameter is required.', example='Ask Mark if he has thought about what his dream job might be.'),
      isOffTopicControl?: boolean(name='isOffTopicControl', example='跑题：true, 不跑题：false'),
      isOnTopic?: boolean(name='isOnTopic', example='扣题：true, 不扣题：false'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      role?: string(name='role', description='This parameter is required.', example='老师：assistant；学生：user'),
    }
  ](name='records'),
  roleInfo?: {
    assistant?: string(name='assistant', description='This parameter is required.', example='Alex'),
    user?: string(name='user', description='This parameter is required.', example='Jamie'),
  }(name='roleInfo', description='This parameter is required.'),
  startSentence?: string(name='startSentence', example='Hello Lily, could you please come to the kitchen for a moment?'),
  topic?: string(name='topic', description='This parameter is required.', example='Let\\\\"s talk about traffic rules.'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model ExecuteAITeacherExpansionDialogueResponseBody = {
  data?: {
    chineseResult?: string(name='chineseResult', example='1'),
    englishResult?: string(name='englishResult', example='1'),
    isFinish?: boolean(name='isFinish', example='true'),
    isOffTopicControl?: boolean(name='isOffTopicControl', example='true'),
    isOnTopic?: boolean(name='isOnTopic', example='true'),
    questionIndex?: int32(name='questionIndex', example='2'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ExecuteAITeacherExpansionDialogueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherExpansionDialogueResponseBody(name='body'),
}

/**
 * @summary 进行拓展练对话
 *
 * @param request ExecuteAITeacherExpansionDialogueRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherExpansionDialogueResponse
 */
async function executeAITeacherExpansionDialogueWithOptions(request: ExecuteAITeacherExpansionDialogueRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherExpansionDialogueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.background)) {
    body['background'] = request.background;
  }
  if (!Util.isUnset(request.dialogueTasks)) {
    body['dialogueTasks'] = request.dialogueTasks;
  }
  if (!Util.isUnset(request.languageCode)) {
    body['languageCode'] = request.languageCode;
  }
  if (!Util.isUnset(request.records)) {
    body['records'] = request.records;
  }
  if (!Util.isUnset(request.roleInfo)) {
    body['roleInfo'] = request.roleInfo;
  }
  if (!Util.isUnset(request.startSentence)) {
    body['startSentence'] = request.startSentence;
  }
  if (!Util.isUnset(request.topic)) {
    body['topic'] = request.topic;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherExpansionDialogue',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/expansionPractice/executeExpansionTraining`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 进行拓展练对话
 *
 * @param request ExecuteAITeacherExpansionDialogueRequest
 * @return ExecuteAITeacherExpansionDialogueResponse
 */
async function executeAITeacherExpansionDialogue(request: ExecuteAITeacherExpansionDialogueRequest): ExecuteAITeacherExpansionDialogueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherExpansionDialogueWithOptions(request, headers, runtime);
}

model ExecuteAITeacherExpansionDialogueRefineRequest {
  background?: string(name='background', description='This parameter is required.', example='In a career counseling session, we are going to discuss our dream jobs and the responsibilities associated with them. Alex, who dreams of becoming a professional travel blogger, will share the tasks and skills required for this role, while Jamie, aspiring to be a wildlife photographer, will outline the responsibilities and challenges of capturing nature\\\\"s moments. Both will explore how their interests align with the practical aspects of their chosen careers, discussing the potential for travel, creativity, and the impact of their work on society and the environment.'),
  dialogueTasks?: [ 
    {
      assistant?: string(name='assistant', description='This parameter is required.', example='Why might some people think dog walking is a great job?'),
      assistantTranslate?: string(name='assistantTranslate', example='为什么有些人认为遛狗是份好差事?'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      user?: string(name='user', description='This parameter is required.', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
    }
  ](name='dialogueTasks', description='This parameter is required.'),
  languageCode?: string(name='languageCode', example='en-gb'),
  records?: [ 
    {
      content?: string(name='content', description='This parameter is required.', example='Ask Mark if he has thought about what his dream job might be.'),
      isOffTopicControl?: boolean(name='isOffTopicControl', example='跑题：true, 不跑题：false'),
      isOnTopic?: boolean(name='isOnTopic', example='扣题：true, 不扣题：false'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      role?: string(name='role', description='This parameter is required.', example='老师：assistant；学生：user'),
    }
  ](name='records', description='This parameter is required.'),
  roleInfo?: {
    assistant?: string(name='assistant', description='This parameter is required.', example='Jane, a caring mother'),
    user?: string(name='user', description='This parameter is required.', example='Lily, a friendly student'),
  }(name='roleInfo', description='This parameter is required.'),
  startSentence?: string(name='startSentence', example='Hello Lily, could you please come to the kitchen for a moment?'),
  topic?: string(name='topic', description='This parameter is required.', example='talk about your dream job.'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model ExecuteAITeacherExpansionDialogueRefineResponseBody = {
  data?: {
    result?: string(name='result', example='Yes, I\\\\"ll be right there.'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ExecuteAITeacherExpansionDialogueRefineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherExpansionDialogueRefineResponseBody(name='body'),
}

/**
 * @summary 拓展练根据上下文进行润色
 *
 * @param request ExecuteAITeacherExpansionDialogueRefineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherExpansionDialogueRefineResponse
 */
async function executeAITeacherExpansionDialogueRefineWithOptions(request: ExecuteAITeacherExpansionDialogueRefineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherExpansionDialogueRefineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.background)) {
    body['background'] = request.background;
  }
  if (!Util.isUnset(request.dialogueTasks)) {
    body['dialogueTasks'] = request.dialogueTasks;
  }
  if (!Util.isUnset(request.languageCode)) {
    body['languageCode'] = request.languageCode;
  }
  if (!Util.isUnset(request.records)) {
    body['records'] = request.records;
  }
  if (!Util.isUnset(request.roleInfo)) {
    body['roleInfo'] = request.roleInfo;
  }
  if (!Util.isUnset(request.startSentence)) {
    body['startSentence'] = request.startSentence;
  }
  if (!Util.isUnset(request.topic)) {
    body['topic'] = request.topic;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherExpansionDialogueRefine',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/expansionPractice/refineByContext`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 拓展练根据上下文进行润色
 *
 * @param request ExecuteAITeacherExpansionDialogueRefineRequest
 * @return ExecuteAITeacherExpansionDialogueRefineResponse
 */
async function executeAITeacherExpansionDialogueRefine(request: ExecuteAITeacherExpansionDialogueRefineRequest): ExecuteAITeacherExpansionDialogueRefineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherExpansionDialogueRefineWithOptions(request, headers, runtime);
}

model ExecuteAITeacherExpansionDialogueTranslateRequest {
  background?: string(name='background', description='This parameter is required.', example='In this dialogue, you will be playing the role of Lily, a young girl. I will be Jane, Lily\\\\"s mother. We are in the kitchen, where I am preparing dinner. I am asking you about your food preferences, specifically if you like meat, fish, and milk. You like meat and milk, but you don\\\\"t like fish because of its smell. I explain to you the nutritional benefits of these foods and suggest alternatives for the ones you don\\\\"t like. Finally, I invite you to start eating.'),
  dialogueTasks?: [ 
    {
      assistant?: string(name='assistant', description='This parameter is required.', example='Why might some people think dog walking is a great job?'),
      assistantTranslate?: string(name='assistantTranslate', example='为什么有些人认为遛狗是份好差事?'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      user?: string(name='user', description='This parameter is required.', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
    }
  ](name='dialogueTasks', description='This parameter is required.'),
  records?: [ 
    {
      content?: string(name='content', description='This parameter is required.', example='Ask Mark if he has thought about what his dream job might be.'),
      isOffTopicControl?: boolean(name='isOffTopicControl', example='跑题：true, 不跑题：false'),
      isOnTopic?: boolean(name='isOnTopic', example='扣题：true, 不扣题：false'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      role?: string(name='role', description='This parameter is required.', example='老师：assistant；学生：user'),
    }
  ](name='records'),
  roleInfo?: {
    assistant?: string(name='assistant', description='This parameter is required.', example='Jane, a caring mother'),
    user?: string(name='user', description='This parameter is required.', example='Lily, a friendly student'),
  }(name='roleInfo', description='This parameter is required.'),
  startSentence?: string(name='startSentence', example='Hello Lily, could you please come to the kitchen for a moment?'),
  topic?: string(name='topic', description='This parameter is required.', example='talk about food.'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model ExecuteAITeacherExpansionDialogueTranslateResponseBody = {
  data?: {
    result?: string(name='result', example='太好了，谢谢你过来，莉莉。你喜欢吃肉吗？'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ExecuteAITeacherExpansionDialogueTranslateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherExpansionDialogueTranslateResponseBody(name='body'),
}

/**
 * @summary 拓展练语境翻译
 *
 * @param request ExecuteAITeacherExpansionDialogueTranslateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherExpansionDialogueTranslateResponse
 */
async function executeAITeacherExpansionDialogueTranslateWithOptions(request: ExecuteAITeacherExpansionDialogueTranslateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherExpansionDialogueTranslateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.background)) {
    body['background'] = request.background;
  }
  if (!Util.isUnset(request.dialogueTasks)) {
    body['dialogueTasks'] = request.dialogueTasks;
  }
  if (!Util.isUnset(request.records)) {
    body['records'] = request.records;
  }
  if (!Util.isUnset(request.roleInfo)) {
    body['roleInfo'] = request.roleInfo;
  }
  if (!Util.isUnset(request.startSentence)) {
    body['startSentence'] = request.startSentence;
  }
  if (!Util.isUnset(request.topic)) {
    body['topic'] = request.topic;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherExpansionDialogueTranslate',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/expansionPractice/translate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 拓展练语境翻译
 *
 * @param request ExecuteAITeacherExpansionDialogueTranslateRequest
 * @return ExecuteAITeacherExpansionDialogueTranslateResponse
 */
async function executeAITeacherExpansionDialogueTranslate(request: ExecuteAITeacherExpansionDialogueTranslateRequest): ExecuteAITeacherExpansionDialogueTranslateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherExpansionDialogueTranslateWithOptions(request, headers, runtime);
}

model ExecuteAITeacherGrammarCheckRequest {
  content?: string(name='content', description='This parameter is required.', example='i is good'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model ExecuteAITeacherGrammarCheckResponseBody = {
  data?: {
    analysis?: string(name='analysis', example='主语 "I" 对应的动词应该是 "am" 而不是 "is"。'),
    correction?: string(name='correction', example='I am good.'),
    correctionStatus?: string(name='correctionStatus', example='Has_Error'),
    errorReason?: string(name='errorReason'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ExecuteAITeacherGrammarCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherGrammarCheckResponseBody(name='body'),
}

/**
 * @summary 语法检测
 *
 * @param request ExecuteAITeacherGrammarCheckRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherGrammarCheckResponse
 */
async function executeAITeacherGrammarCheckWithOptions(request: ExecuteAITeacherGrammarCheckRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherGrammarCheckResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherGrammarCheck',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/common/grammarChecking`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 语法检测
 *
 * @param request ExecuteAITeacherGrammarCheckRequest
 * @return ExecuteAITeacherGrammarCheckResponse
 */
async function executeAITeacherGrammarCheck(request: ExecuteAITeacherGrammarCheckRequest): ExecuteAITeacherGrammarCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherGrammarCheckWithOptions(request, headers, runtime);
}

model ExecuteAITeacherSyncDialogueRequest {
  dialogueTasks?: [ 
    {
      assistant?: string(name='assistant', description='This parameter is required.', example='Why might some people think dog walking is a great job?'),
      assistantTranslate?: string(name='assistantTranslate', example='为什么有些人认为遛狗是份好差事?'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      user?: string(name='user', description='This parameter is required.', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
    }
  ](name='dialogueTasks', description='This parameter is required.'),
  languageCode?: string(name='languageCode', example='en-gb'),
  records?: [ 
    {
      content?: string(name='content', description='This parameter is required.', example='Ask Mark if he has thought about what his dream job might be.'),
      isOffTopicControl?: boolean(name='isOffTopicControl', example='跑题：true, 不跑题：false'),
      isOnTopic?: boolean(name='isOnTopic', example='扣题：true, 不扣题：false'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      role?: string(name='role', description='This parameter is required.', example='老师：assistant；学生：user'),
    }
  ](name='records'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model ExecuteAITeacherSyncDialogueResponseBody = {
  data?: {
    englishResult?: string(name='englishResult', example='Thanks, Lily. Do you like meat, Lily?'),
    isFinish?: boolean(name='isFinish', example='true'),
    isOnTopic?: boolean(name='isOnTopic', example='true'),
    questionIndex?: int32(name='questionIndex', example='2'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ExecuteAITeacherSyncDialogueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherSyncDialogueResponseBody(name='body'),
}

/**
 * @summary 进行同步练对话
 *
 * @param request ExecuteAITeacherSyncDialogueRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherSyncDialogueResponse
 */
async function executeAITeacherSyncDialogueWithOptions(request: ExecuteAITeacherSyncDialogueRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherSyncDialogueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dialogueTasks)) {
    body['dialogueTasks'] = request.dialogueTasks;
  }
  if (!Util.isUnset(request.languageCode)) {
    body['languageCode'] = request.languageCode;
  }
  if (!Util.isUnset(request.records)) {
    body['records'] = request.records;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherSyncDialogue',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/syncPractice/executeSyncTraining`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 进行同步练对话
 *
 * @param request ExecuteAITeacherSyncDialogueRequest
 * @return ExecuteAITeacherSyncDialogueResponse
 */
async function executeAITeacherSyncDialogue(request: ExecuteAITeacherSyncDialogueRequest): ExecuteAITeacherSyncDialogueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherSyncDialogueWithOptions(request, headers, runtime);
}

model ExecuteAITeacherSyncDialogueTranslateRequest {
  dialogueTasks?: [ 
    {
      assistant?: string(name='assistant', description='This parameter is required.', example='Why might some people think dog walking is a great job?'),
      assistantTranslate?: string(name='assistantTranslate', example='为什么有些人认为遛狗是份好差事?'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      user?: string(name='user', description='This parameter is required.', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
    }
  ](name='dialogueTasks', description='This parameter is required.'),
  records?: [ 
    {
      content?: string(name='content', description='This parameter is required.', example='Ask Mark if he has thought about what his dream job might be.'),
      isOffTopicControl?: boolean(name='isOffTopicControl', example='跑题：true, 不跑题：false'),
      isOnTopic?: boolean(name='isOnTopic', example='扣题：true, 不扣题：false'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      role?: string(name='role', description='This parameter is required.', example='老师：assistant；学生：user'),
    }
  ](name='records'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model ExecuteAITeacherSyncDialogueTranslateResponseBody = {
  data?: {
    result?: string(name='result', example='太好了，谢谢你过来，莉莉。你喜欢吃肉吗？'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ExecuteAITeacherSyncDialogueTranslateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteAITeacherSyncDialogueTranslateResponseBody(name='body'),
}

/**
 * @summary 同步练语境翻译
 *
 * @param request ExecuteAITeacherSyncDialogueTranslateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteAITeacherSyncDialogueTranslateResponse
 */
async function executeAITeacherSyncDialogueTranslateWithOptions(request: ExecuteAITeacherSyncDialogueTranslateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteAITeacherSyncDialogueTranslateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dialogueTasks)) {
    body['dialogueTasks'] = request.dialogueTasks;
  }
  if (!Util.isUnset(request.records)) {
    body['records'] = request.records;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteAITeacherSyncDialogueTranslate',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/syncPractice/translate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 同步练语境翻译
 *
 * @param request ExecuteAITeacherSyncDialogueTranslateRequest
 * @return ExecuteAITeacherSyncDialogueTranslateResponse
 */
async function executeAITeacherSyncDialogueTranslate(request: ExecuteAITeacherSyncDialogueTranslateRequest): ExecuteAITeacherSyncDialogueTranslateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeAITeacherSyncDialogueTranslateWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantDialogueRequest {
  authToken?: string(name='authToken', description='This parameter is required.'),
  chatId?: string(name='chatId', description='This parameter is required.'),
  scenario?: string(name='scenario', description='This parameter is required.'),
  userMessage?: string(name='userMessage', description='This parameter is required.'),
}

model ExecuteTextbookAssistantDialogueResponseBody = {
  data?: {
    assistant?: string(name='assistant'),
    chatId?: string(name='chatId'),
    result?: {
      chineseResult?: string(name='chineseResult'),
      englishResult?: string(name='englishResult'),
      isFinish?: boolean(name='isFinish'),
      isTaskCompleted?: boolean(name='isTaskCompleted'),
    }(name='result'),
    user?: string(name='user'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: string(name='httpStatusCode'),
  requestId?: string(name='requestId', description='Id of the request'),
  success?: string(name='success'),
}

model ExecuteTextbookAssistantDialogueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantDialogueResponseBody(name='body'),
}

/**
 * @summary 进行AI对话
 *
 * @param request ExecuteTextbookAssistantDialogueRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantDialogueResponse
 */
async function executeTextbookAssistantDialogueWithOptions(request: ExecuteTextbookAssistantDialogueRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantDialogueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }
  if (!Util.isUnset(request.userMessage)) {
    body['userMessage'] = request.userMessage;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantDialogue',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/ExecuteDialogue`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 进行AI对话
 *
 * @param request ExecuteTextbookAssistantDialogueRequest
 * @return ExecuteTextbookAssistantDialogueResponse
 */
async function executeTextbookAssistantDialogue(request: ExecuteTextbookAssistantDialogueRequest): ExecuteTextbookAssistantDialogueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantDialogueWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantDifficultyRequest {
  action?: string(name='action', description='This parameter is required.', example='UP'),
  assistant?: string(name='assistant', description='This parameter is required.', example='6788f4a6b54c5268c1b78a25'),
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  chatId?: string(name='chatId', description='This parameter is required.', example='6788e0b475a4631ffc626722'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
}

model ExecuteTextbookAssistantDifficultyResponseBody = {
  data?: {
    result?: {
      result?: string(name='result', example='Let\\\\"s look at the text again. Mike says, \\\\"I\\\\"m Mike Black.\\\\" Can you try saying it like Mike?'),
    }(name='result'),
  }(name='data'),
  errCode?: string(name='errCode', example='null'),
  errMessage?: string(name='errMessage', example='null'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='0D7D382F-9475-572E-BE83-DDFBF5C5EB24'),
  success?: boolean(name='success', example='true'),
}

model ExecuteTextbookAssistantDifficultyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantDifficultyResponseBody(name='body'),
}

/**
 * @summary 调整难度
 *
 * @param request ExecuteTextbookAssistantDifficultyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantDifficultyResponse
 */
async function executeTextbookAssistantDifficultyWithOptions(request: ExecuteTextbookAssistantDifficultyRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantDifficultyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.action)) {
    body['action'] = request.action;
  }
  if (!Util.isUnset(request.assistant)) {
    body['assistant'] = request.assistant;
  }
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantDifficulty',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/ExecuteDifficulty`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 调整难度
 *
 * @param request ExecuteTextbookAssistantDifficultyRequest
 * @return ExecuteTextbookAssistantDifficultyResponse
 */
async function executeTextbookAssistantDifficulty(request: ExecuteTextbookAssistantDifficultyRequest): ExecuteTextbookAssistantDifficultyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantDifficultyWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantGrammarCheckRequest {
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  chatId?: string(name='chatId', description='This parameter is required.', example='6788e0b475a4631ffc626722'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
  user?: string(name='user', description='This parameter is required.', example='6788e0b45bdfc807f077a5a1'),
}

model ExecuteTextbookAssistantGrammarCheckResponseBody = {
  data?: {
    result?: {
      analysis?: string(name='analysis'),
      correction?: string(name='correction', example='I am you.'),
      correctionStatus?: string(name='correctionStatus', example='Has_Error'),
    }(name='result'),
  }(name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: string(name='errMessage', example='null'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='0bc1e96d17091734639835114e12c8'),
  success?: boolean(name='success', example='true'),
}

model ExecuteTextbookAssistantGrammarCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantGrammarCheckResponseBody(name='body'),
}

/**
 * @summary 语法检测
 *
 * @param request ExecuteTextbookAssistantGrammarCheckRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantGrammarCheckResponse
 */
async function executeTextbookAssistantGrammarCheckWithOptions(request: ExecuteTextbookAssistantGrammarCheckRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantGrammarCheckResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }
  if (!Util.isUnset(request.user)) {
    body['user'] = request.user;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantGrammarCheck',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/ExecuteGrammarCheck`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 语法检测
 *
 * @param request ExecuteTextbookAssistantGrammarCheckRequest
 * @return ExecuteTextbookAssistantGrammarCheckResponse
 */
async function executeTextbookAssistantGrammarCheck(request: ExecuteTextbookAssistantGrammarCheckRequest): ExecuteTextbookAssistantGrammarCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantGrammarCheckWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantRefineByContextRequest {
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  chatId?: string(name='chatId', description='This parameter is required.', example='6788e0b475a4631ffc626722'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
  user?: string(name='user', description='This parameter is required.', example='6788e0b45bdfc807f077a5a1'),
}

model ExecuteTextbookAssistantRefineByContextResponseBody = {
  data?: {
    result?: {
      result?: string(name='result', example='Good evening! From the book, how does Mike Black introduce himself?'),
    }(name='result'),
  }(name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: int32(name='errMessage', example='null'),
  httpStatusCode?: string(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='6F73C114-A76E-51AD-99E3-BC7B941B69E0'),
  success?: boolean(name='success', example='true'),
}

model ExecuteTextbookAssistantRefineByContextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantRefineByContextResponseBody(name='body'),
}

/**
 * @summary 句子润色
 *
 * @param request ExecuteTextbookAssistantRefineByContextRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantRefineByContextResponse
 */
async function executeTextbookAssistantRefineByContextWithOptions(request: ExecuteTextbookAssistantRefineByContextRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantRefineByContextResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }
  if (!Util.isUnset(request.user)) {
    body['user'] = request.user;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantRefineByContext',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/RefineByContext`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 句子润色
 *
 * @param request ExecuteTextbookAssistantRefineByContextRequest
 * @return ExecuteTextbookAssistantRefineByContextResponse
 */
async function executeTextbookAssistantRefineByContext(request: ExecuteTextbookAssistantRefineByContextRequest): ExecuteTextbookAssistantRefineByContextResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantRefineByContextWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantRetryConversationRequest {
  assistant?: string(name='assistant', description='This parameter is required.', example='6788e0b4b54c5268c1b78638'),
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  chatId?: string(name='chatId', description='This parameter is required.', example='6788e0b475a4631ffc626722'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
}

model ExecuteTextbookAssistantRetryConversationResponseBody = {
  data?: {
    assistant?: string(name='assistant', example='6788e0b4b54c5268c1b78638'),
    chatId?: string(name='chatId', example='6788e0b475a4631ffc626722'),
    result?: {
      chineseResult?: string(name='chineseResult'),
      englishResult?: string(name='englishResult', example='Good evening! From the book, how does Mike Black introduce himself?'),
    }(name='result'),
    user?: string(name='user', example='6788e0b45bdfc807f077a5a1'),
  }(name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: string(name='errMessage', example='null'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='2F2ABF4B-A4F6-5EC7-B287-7EF5B156F1ED'),
  success?: boolean(name='success', example='true'),
}

model ExecuteTextbookAssistantRetryConversationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantRetryConversationResponseBody(name='body'),
}

/**
 * @summary 对话重试
 *
 * @param request ExecuteTextbookAssistantRetryConversationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantRetryConversationResponse
 */
async function executeTextbookAssistantRetryConversationWithOptions(request: ExecuteTextbookAssistantRetryConversationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantRetryConversationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assistant)) {
    body['assistant'] = request.assistant;
  }
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantRetryConversation',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/RetryConversation`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 对话重试
 *
 * @param request ExecuteTextbookAssistantRetryConversationRequest
 * @return ExecuteTextbookAssistantRetryConversationResponse
 */
async function executeTextbookAssistantRetryConversation(request: ExecuteTextbookAssistantRetryConversationRequest): ExecuteTextbookAssistantRetryConversationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantRetryConversationWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantSseDialogueRequest {
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  chatId?: string(name='chatId', description='This parameter is required.', example='67e374acb54c526c95c4fbd4'),
  scenario?: string(name='scenario', description='This parameter is required.', example='EXPAND'),
  userMessage?: string(name='userMessage', description='This parameter is required.', example='hello'),
}

model ExecuteTextbookAssistantSseDialogueResponseBody = {
  assistant?: string(name='assistant', example='67e4c9d95bdfc83cd742ae7c'),
  chatId?: string(name='chatId', example='67e374acb54c526c95c4fbd4'),
  data?: {
    englishResult?: string(name='englishResult', example='Thanks, Lily. Do you like meat, Lily?'),
    isFinish?: boolean(name='isFinish', example='true'),
  }(name='data'),
  errCode?: string(name='errCode', example='BIZ_ERROR'),
  errMessage?: string(name='errMessage'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
  user?: string(name='user', example='67e4c9d6b54c526c95c53925'),
}

model ExecuteTextbookAssistantSseDialogueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantSseDialogueResponseBody(name='body'),
}

/**
 * @summary 进行对话-流式输出
 *
 * @param request ExecuteTextbookAssistantSseDialogueRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantSseDialogueResponse
 */
async function executeTextbookAssistantSseDialogueWithOptions(request: ExecuteTextbookAssistantSseDialogueRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantSseDialogueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }
  if (!Util.isUnset(request.userMessage)) {
    body['userMessage'] = request.userMessage;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantSseDialogue',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/ExecuteSseDialogue`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 进行对话-流式输出
 *
 * @param request ExecuteTextbookAssistantSseDialogueRequest
 * @return ExecuteTextbookAssistantSseDialogueResponse
 */
async function executeTextbookAssistantSseDialogue(request: ExecuteTextbookAssistantSseDialogueRequest): ExecuteTextbookAssistantSseDialogueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantSseDialogueWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantStartConversationRequest {
  articleId?: string(name='articleId', description='This parameter is required.', example='0c05700d4d9411efbe6e0c42a106bb02'),
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
}

model ExecuteTextbookAssistantStartConversationResponseBody = {
  data?: {
    assistant?: string(name='assistant', example='6788e0b4b54c5268c1b78638'),
    chatId?: string(name='chatId', example='6788e0b475a4631ffc626722'),
    result?: {
      chineseResult?: string(name='chineseResult'),
      englishResult?: string(name='englishResult', example='Good evening! From the book, how does Mike Black introduce himself?'),
    }(name='result'),
    user?: string(name='user', example='6788e0b45bdfc807f077a5a1'),
  }(name='data'),
  errCode?: string(name='errCode', example='B_USER_NOT_FOUND_EXCEPTION'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='6F73C114-A76E-51AD-99E3-BC7B941B69E0'),
  success?: boolean(name='success', example='true'),
}

model ExecuteTextbookAssistantStartConversationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantStartConversationResponseBody(name='body'),
}

/**
 * @summary 开启自由对话
 *
 * @param request ExecuteTextbookAssistantStartConversationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantStartConversationResponse
 */
async function executeTextbookAssistantStartConversationWithOptions(request: ExecuteTextbookAssistantStartConversationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantStartConversationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.articleId)) {
    body['articleId'] = request.articleId;
  }
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantStartConversation',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/StartConversation`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 开启自由对话
 *
 * @param request ExecuteTextbookAssistantStartConversationRequest
 * @return ExecuteTextbookAssistantStartConversationResponse
 */
async function executeTextbookAssistantStartConversation(request: ExecuteTextbookAssistantStartConversationRequest): ExecuteTextbookAssistantStartConversationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantStartConversationWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantSuggestionRequest {
  assistant?: string(name='assistant', description='This parameter is required.', example='6788e0b4b54c5268c1b78638'),
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  chatId?: string(name='chatId', description='This parameter is required.', example='6788e0b4b54c5268c1b78638'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
}

model ExecuteTextbookAssistantSuggestionResponseBody = {
  data?: {
    result?: {
      chineseResult?: string(name='chineseResult'),
      englishResult?: string(name='englishResult', example='Good evening! From the book, how does Mike Black introduce himself?'),
    }(name='result'),
  }(name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: string(name='errMessage', example='null'),
  httpstatusCode?: int32(name='httpstatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='0D7D382F-9475-572E-BE83-DDFBF5C5EB24'),
  success?: boolean(name='success', example='true'),
}

model ExecuteTextbookAssistantSuggestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantSuggestionResponseBody(name='body'),
}

/**
 * @summary 获取鉴权参数
 *
 * @param request ExecuteTextbookAssistantSuggestionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantSuggestionResponse
 */
async function executeTextbookAssistantSuggestionWithOptions(request: ExecuteTextbookAssistantSuggestionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantSuggestionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assistant)) {
    body['assistant'] = request.assistant;
  }
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantSuggestion',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/Suggestion`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取鉴权参数
 *
 * @param request ExecuteTextbookAssistantSuggestionRequest
 * @return ExecuteTextbookAssistantSuggestionResponse
 */
async function executeTextbookAssistantSuggestion(request: ExecuteTextbookAssistantSuggestionRequest): ExecuteTextbookAssistantSuggestionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantSuggestionWithOptions(request, headers, runtime);
}

model ExecuteTextbookAssistantTranslateRequest {
  assistant?: string(name='assistant', description='This parameter is required.', example='6788e0b4b54c5268c1b78638'),
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  chatId?: string(name='chatId', description='This parameter is required.', example='6788e0b475a4631ffc626722'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
}

model ExecuteTextbookAssistantTranslateResponseBody = {
  data?: {
    result?: {
      result?: string(name='result'),
    }(name='result'),
  }(name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: string(name='errMessage', example='""'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='9EB79C1E-36C2-5777-BED6-C23A98DF0637'),
  success?: boolean(name='success', example='true'),
}

model ExecuteTextbookAssistantTranslateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteTextbookAssistantTranslateResponseBody(name='body'),
}

/**
 * @summary 翻译消息内容
 *
 * @param request ExecuteTextbookAssistantTranslateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteTextbookAssistantTranslateResponse
 */
async function executeTextbookAssistantTranslateWithOptions(request: ExecuteTextbookAssistantTranslateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExecuteTextbookAssistantTranslateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assistant)) {
    body['assistant'] = request.assistant;
  }
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.chatId)) {
    body['chatId'] = request.chatId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteTextbookAssistantTranslate',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/dialogue/ExecuteTranslate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 翻译消息内容
 *
 * @param request ExecuteTextbookAssistantTranslateRequest
 * @return ExecuteTextbookAssistantTranslateResponse
 */
async function executeTextbookAssistantTranslate(request: ExecuteTextbookAssistantTranslateRequest): ExecuteTextbookAssistantTranslateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return executeTextbookAssistantTranslateWithOptions(request, headers, runtime);
}

model GetAITeacherExpansionDialogueSuggestionRequest {
  background?: string(name='background', description='This parameter is required.', example='In a career counseling session, we are going to discuss our dream jobs and the responsibilities associated with them. Alex, who dreams of becoming a professional travel blogger, will share the tasks and skills required for this role, while Jamie, aspiring to be a wildlife photographer, will outline the responsibilities and challenges of capturing nature\\\\"s moments. Both will explore how their interests align with the practical aspects of their chosen careers, discussing the potential for travel, creativity, and the impact of their work on society and the environment.'),
  dialogueTasks?: [ 
    {
      assistant?: string(name='assistant', description='This parameter is required.', example='Why might some people think dog walking is a great job?'),
      assistantTranslate?: string(name='assistantTranslate', example='为什么有些人认为遛狗是份好差事?'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      user?: string(name='user', description='This parameter is required.', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
    }
  ](name='dialogueTasks', description='This parameter is required.'),
  languageCode?: string(name='languageCode', example='en-gb'),
  records?: [ 
    {
      content?: string(name='content', description='This parameter is required.', example='Ask Mark if he has thought about what his dream job might be.'),
      isOffTopicControl?: boolean(name='isOffTopicControl', example='跑题：true, 不跑题：false'),
      isOnTopic?: boolean(name='isOnTopic', example='扣题：true, 不扣题：false'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      role?: string(name='role', description='This parameter is required.', example='老师：assistant；学生：user'),
    }
  ](name='records', description='This parameter is required.'),
  roleInfo?: {
    assistant?: string(name='assistant', description='This parameter is required.', example='Alex'),
    user?: string(name='user', description='This parameter is required.', example='Jamie'),
  }(name='roleInfo', description='This parameter is required.'),
  startSentence?: string(name='startSentence', example='Hello Lily, could you please come to the kitchen for a moment?'),
  topic?: string(name='topic', description='This parameter is required.', example='Let\\\\"s talk about traffic rules.'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model GetAITeacherExpansionDialogueSuggestionResponseBody = {
  data?: {
    chineseResult?: string(name='chineseResult', example='谢谢莉莉.你喜欢吃肉吗，莉莉？'),
    englishResult?: string(name='englishResult', example='Thanks, Lily. Do you like meat, Lily?'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model GetAITeacherExpansionDialogueSuggestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAITeacherExpansionDialogueSuggestionResponseBody(name='body'),
}

/**
 * @summary 拓展练小助手
 *
 * @param request GetAITeacherExpansionDialogueSuggestionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAITeacherExpansionDialogueSuggestionResponse
 */
async function getAITeacherExpansionDialogueSuggestionWithOptions(request: GetAITeacherExpansionDialogueSuggestionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetAITeacherExpansionDialogueSuggestionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.background)) {
    body['background'] = request.background;
  }
  if (!Util.isUnset(request.dialogueTasks)) {
    body['dialogueTasks'] = request.dialogueTasks;
  }
  if (!Util.isUnset(request.languageCode)) {
    body['languageCode'] = request.languageCode;
  }
  if (!Util.isUnset(request.records)) {
    body['records'] = request.records;
  }
  if (!Util.isUnset(request.roleInfo)) {
    body['roleInfo'] = request.roleInfo;
  }
  if (!Util.isUnset(request.startSentence)) {
    body['startSentence'] = request.startSentence;
  }
  if (!Util.isUnset(request.topic)) {
    body['topic'] = request.topic;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetAITeacherExpansionDialogueSuggestion',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/expansionPractice/suggestion`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 拓展练小助手
 *
 * @param request GetAITeacherExpansionDialogueSuggestionRequest
 * @return GetAITeacherExpansionDialogueSuggestionResponse
 */
async function getAITeacherExpansionDialogueSuggestion(request: GetAITeacherExpansionDialogueSuggestionRequest): GetAITeacherExpansionDialogueSuggestionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAITeacherExpansionDialogueSuggestionWithOptions(request, headers, runtime);
}

model GetAITeacherSyncDialogueSuggestionRequest {
  dialogueTasks?: [ 
    {
      assistant?: string(name='assistant', description='This parameter is required.', example='Why might some people think dog walking is a great job?'),
      assistantTranslate?: string(name='assistantTranslate', example='为什么有些人认为遛狗是份好差事?'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      user?: string(name='user', description='This parameter is required.', example='They think it\\\\"s great because they won\\\\"t be stuck in an office.'),
    }
  ](name='dialogueTasks', description='This parameter is required.'),
  languageCode?: string(name='languageCode', example='en-gb'),
  records?: [ 
    {
      content?: string(name='content', description='This parameter is required.', example='Ask Mark if he has thought about what his dream job might be.'),
      isOffTopicControl?: boolean(name='isOffTopicControl', example='跑题：true, 不跑题：false'),
      isOnTopic?: boolean(name='isOnTopic', example='扣题：true, 不扣题：false'),
      order?: int32(name='order', description='This parameter is required.', example='1'),
      role?: string(name='role', description='This parameter is required.', example='老师：assistant；学生：user'),
    }
  ](name='records', description='This parameter is required.'),
  userId?: string(name='userId', description='This parameter is required.', example='886eba3702xxxxxxxxx4ba52a87a525'),
}

model GetAITeacherSyncDialogueSuggestionResponseBody = {
  data?: {
    chineseResult?: string(name='chineseResult', example='谢谢莉莉.你喜欢吃肉吗，莉莉？'),
    englishResult?: string(name='englishResult', example='Thanks, Lily. Do you like meat, Lily?'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model GetAITeacherSyncDialogueSuggestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAITeacherSyncDialogueSuggestionResponseBody(name='body'),
}

/**
 * @summary 同步练小助手
 *
 * @param request GetAITeacherSyncDialogueSuggestionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAITeacherSyncDialogueSuggestionResponse
 */
async function getAITeacherSyncDialogueSuggestionWithOptions(request: GetAITeacherSyncDialogueSuggestionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetAITeacherSyncDialogueSuggestionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dialogueTasks)) {
    body['dialogueTasks'] = request.dialogueTasks;
  }
  if (!Util.isUnset(request.languageCode)) {
    body['languageCode'] = request.languageCode;
  }
  if (!Util.isUnset(request.records)) {
    body['records'] = request.records;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetAITeacherSyncDialogueSuggestion',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aiteacher/syncPractice/suggestion`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 同步练小助手
 *
 * @param request GetAITeacherSyncDialogueSuggestionRequest
 * @return GetAITeacherSyncDialogueSuggestionResponse
 */
async function getAITeacherSyncDialogueSuggestion(request: GetAITeacherSyncDialogueSuggestionRequest): GetAITeacherSyncDialogueSuggestionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAITeacherSyncDialogueSuggestionWithOptions(request, headers, runtime);
}

model GetTextbookAssistantTokenRequest {
  deviceId?: string(name='deviceId', description='This parameter is required.', example='700d4d9411efbe6e0', nullable=false),
  model?: string(name='model', description='This parameter is required.', example='25032PS56C'),
}

model GetTextbookAssistantTokenResponseBody = {
  data?: {
    authToken?: string(name='authToken', example='tc_197bf5bb81889cc79eb51ae9b8c0cea3'),
    expire?: int32(name='expire', example='5400'),
  }(name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='0A5E9849-A2F0-551D-A7D8-1A8118557BAB'),
  success?: boolean(name='success', example='true'),
}

model GetTextbookAssistantTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTextbookAssistantTokenResponseBody(name='body'),
}

/**
 * @summary 获取请求鉴权参数
 *
 * @param request GetTextbookAssistantTokenRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTextbookAssistantTokenResponse
 */
async function getTextbookAssistantTokenWithOptions(request: GetTextbookAssistantTokenRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTextbookAssistantTokenResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.deviceId)) {
    body['deviceId'] = request.deviceId;
  }
  if (!Util.isUnset(request.model)) {
    body['model'] = request.model;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTextbookAssistantToken',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/teachingResource/GetToken`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取请求鉴权参数
 *
 * @param request GetTextbookAssistantTokenRequest
 * @return GetTextbookAssistantTokenResponse
 */
async function getTextbookAssistantToken(request: GetTextbookAssistantTokenRequest): GetTextbookAssistantTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTextbookAssistantTokenWithOptions(request, headers, runtime);
}

model ListTextbookAssistantArticleDetailsRequest {
  articleIdList?: [ string ](name='articleIdList'),
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
}

model ListTextbookAssistantArticleDetailsResponseBody = {
  data?: [ 
    {
      articleId?: string(name='articleId', example='0c05700d4d9411efbe6e0c42a106bb02'),
      questionList?: [ 
        {
          answer?: string(name='answer', example='I\\\\"m Mike Black'),
          question?: string(name='question', example='From the book, how does Mike Black introduce himself?'),
          questionTranslate?: string(name='questionTranslate'),
        }
      ](name='questionList'),
      sceneList?: [ 
        {
          scene?: string(name='scene', example='In the park, you introduce yourself to John and ask his name.'),
          sceneId?: string(name='sceneId', example='38cddd70509911efbe6e0c42a106bb02'),
          sceneImageList?: [ string ](name='sceneImageList'),
          sceneTransLate?: string(name='sceneTransLate'),
        }
      ](name='sceneList'),
      sentenceList?: [ 
        {
          sentenceAnalysis?: string(name='sentenceAnalysis'),
          sentenceId?: string(name='sentenceId', example='4de677d2509811efbe6e0c42a106bb02'),
          sentenceText?: string(name='sentenceText', example='I\\\\"m Mike Black'),
        }
      ](name='sentenceList'),
      target?: string(name='target'),
      theme?: {
        themeImageList?: [ string ](name='themeImageList'),
        themeName?: string(name='themeName'),
        themeTranslate?: string(name='themeTranslate', example='Self-awareness, self-management, self-improvement'),
      }(name='theme'),
      topic?: {
        topicImageList?: [ string ](name='topicImageList'),
        topicName?: string(name='topicName'),
        topicTranslate?: string(name='topicTranslate', example='Greetings and self-introduction'),
      }(name='topic'),
      wordList?: [ 
        {
          wordAnalysis?: string(name='wordAnalysis'),
          wordId?: string(name='wordId', example='a94df134ed8c11eebe6e0c42a106bb02'),
          wordText?: string(name='wordText', example='nice'),
        }
      ](name='wordList'),
    }
  ](name='data'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ListTextbookAssistantArticleDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTextbookAssistantArticleDetailsResponseBody(name='body'),
}

/**
 * @summary 批量获取文章详情
 *
 * @param request ListTextbookAssistantArticleDetailsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTextbookAssistantArticleDetailsResponse
 */
async function listTextbookAssistantArticleDetailsWithOptions(request: ListTextbookAssistantArticleDetailsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTextbookAssistantArticleDetailsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.articleIdList)) {
    body['articleIdList'] = request.articleIdList;
  }
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTextbookAssistantArticleDetails',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/teachingResource/ListArticleDetails`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量获取文章详情
 *
 * @param request ListTextbookAssistantArticleDetailsRequest
 * @return ListTextbookAssistantArticleDetailsResponse
 */
async function listTextbookAssistantArticleDetails(request: ListTextbookAssistantArticleDetailsRequest): ListTextbookAssistantArticleDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTextbookAssistantArticleDetailsWithOptions(request, headers, runtime);
}

model ListTextbookAssistantArticlesRequest {
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_a893b8492c4be046cbc906c566aeb8c9'),
  directoryId?: string(name='directoryId', description='This parameter is required.', example='90aa861b4d9311efbe6e0c42a106bb02'),
}

model ListTextbookAssistantArticlesResponseBody = {
  data?: [ 
    {
      articleId?: string(name='articleId', example='0c05700d4d9411efbe6e0c42a106bb02'),
    }
  ](name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='70412360-4272-571A-827D-84C2C07C450F'),
  success?: boolean(name='success', example='true'),
}

model ListTextbookAssistantArticlesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTextbookAssistantArticlesResponseBody(name='body'),
}

/**
 * @summary 获取文章列表
 *
 * @param request ListTextbookAssistantArticlesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTextbookAssistantArticlesResponse
 */
async function listTextbookAssistantArticlesWithOptions(request: ListTextbookAssistantArticlesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTextbookAssistantArticlesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.directoryId)) {
    body['directoryId'] = request.directoryId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTextbookAssistantArticles',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/teachingResource/ListArticles`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取文章列表
 *
 * @param request ListTextbookAssistantArticlesRequest
 * @return ListTextbookAssistantArticlesResponse
 */
async function listTextbookAssistantArticles(request: ListTextbookAssistantArticlesRequest): ListTextbookAssistantArticlesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTextbookAssistantArticlesWithOptions(request, headers, runtime);
}

model ListTextbookAssistantBookDirectoriesRequest {
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  bookId?: string(name='bookId', description='This parameter is required.', example='231698'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
}

model ListTextbookAssistantBookDirectoriesResponseBody = {
  data?: {
    directoryTree?: [ 
      {
        directoryId?: string(name='directoryId', example='05758807ed8e11eebe6e0c42a106bb02'),
        directoryName?: string(name='directoryName', example='2 Jobs'),
        topic?: [ 
          {
            labelId?: string(name='labelId', example='1323'),
            labelName?: string(name='labelName'),
          }
        ](name='topic'),
      }
    ](name='directoryTree'),
    editionInfo?: {
      bookId?: string(name='bookId', example='55857'),
      bookVolume?: string(name='bookVolume', example='1'),
      edition?: string(name='edition', example='2010-1(2)'),
      grade?: string(name='grade', example='3'),
      impression?: string(name='impression', example='2019-1(10)'),
      isbn?: string(name='isbn', example='9787544413695'),
      publisher?: string(name='publisher'),
      subject?: string(name='subject', example='ENGLISH'),
      version?: string(name='version'),
    }(name='editionInfo'),
  }(name='data'),
  errCode?: string(name='errCode', example='B_USER_NOT_FOUND_EXCEPTION'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='0A5E9849-A2F0-551D-A7D8-1A8118557BAB'),
  success?: boolean(name='success', example='true'),
}

model ListTextbookAssistantBookDirectoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTextbookAssistantBookDirectoriesResponseBody(name='body'),
}

/**
 * @summary 获取书本下的目录信息
 *
 * @param request ListTextbookAssistantBookDirectoriesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTextbookAssistantBookDirectoriesResponse
 */
async function listTextbookAssistantBookDirectoriesWithOptions(request: ListTextbookAssistantBookDirectoriesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTextbookAssistantBookDirectoriesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.bookId)) {
    body['bookId'] = request.bookId;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTextbookAssistantBookDirectories',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/teachingResource/ListBookDirectories`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取书本下的目录信息
 *
 * @param request ListTextbookAssistantBookDirectoriesRequest
 * @return ListTextbookAssistantBookDirectoriesResponse
 */
async function listTextbookAssistantBookDirectories(request: ListTextbookAssistantBookDirectoriesRequest): ListTextbookAssistantBookDirectoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTextbookAssistantBookDirectoriesWithOptions(request, headers, runtime);
}

model ListTextbookAssistantBooksRequest {
  authToken?: string(name='authToken', description='This parameter is required.', example='tc_197bf5bb81889cc79eb51ae9b8c0cea3'),
  bookId?: string(name='bookId', example='231698'),
  grade?: string(name='grade', example='1'),
  maxResults?: string(name='maxResults', example='20'),
  page?: string(name='page', example='1'),
  version?: string(name='version'),
  volume?: string(name='volume', example='1'),
}

model ListTextbookAssistantBooksResponseBody = {
  data?: {
    bookList?: [ 
      {
        author?: string(name='author'),
        bookId?: string(name='bookId', example='231698'),
        bookName?: string(name='bookName'),
        coverImage?: string(name='coverImage', example='null'),
        edition?: string(name='edition', example='2024-7（1）'),
        grade?: string(name='grade', example='3'),
        impression?: string(name='impression', example='2024-7（1）'),
        isbn?: string(name='isbn', example='9787107382505'),
        publisher?: string(name='publisher'),
        subject?: string(name='subject', example='ENGLISH'),
        version?: string(name='version'),
        volume?: string(name='volume', example='0'),
      }
    ](name='bookList'),
    paginationData?: {
      currentPage?: int32(name='currentPage', example='1'),
      maxResults?: int32(name='maxResults', example='20'),
      totalCount?: int32(name='totalCount', example='200'),
    }(name='paginationData'),
  }(name='data'),
  errCode?: string(name='errCode', example='B_USER_NOT_FOUND_EXCEPTION'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='B695B377-7029-5805-9DE2-1AAE06C1BF6B'),
  success?: boolean(name='success', example='true'),
}

model ListTextbookAssistantBooksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTextbookAssistantBooksResponseBody(name='body'),
}

/**
 * @summary 获取包含年级下的书本列表
 *
 * @param request ListTextbookAssistantBooksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTextbookAssistantBooksResponse
 */
async function listTextbookAssistantBooksWithOptions(request: ListTextbookAssistantBooksRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTextbookAssistantBooksResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.bookId)) {
    body['bookId'] = request.bookId;
  }
  if (!Util.isUnset(request.grade)) {
    body['grade'] = request.grade;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.page)) {
    body['page'] = request.page;
  }
  if (!Util.isUnset(request.version)) {
    body['version'] = request.version;
  }
  if (!Util.isUnset(request.volume)) {
    body['volume'] = request.volume;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTextbookAssistantBooks',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/teachingResource/ListBooks`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取包含年级下的书本列表
 *
 * @param request ListTextbookAssistantBooksRequest
 * @return ListTextbookAssistantBooksResponse
 */
async function listTextbookAssistantBooks(request: ListTextbookAssistantBooksRequest): ListTextbookAssistantBooksResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTextbookAssistantBooksWithOptions(request, headers, runtime);
}

model ListTextbookAssistantGradeVolumesRequest {
  authToken?: string(name='authToken', example='tc_197bf5bb81889cc79eb51ae9b8c0cea3'),
  scenario?: string(name='scenario', description='This parameter is required.', example='SYNC'),
}

model ListTextbookAssistantGradeVolumesResponseBody = {
  data?: {
    gradeVolumes?: [ 
      {
        grade?: string(name='grade', description='This parameter is required.', example='3'),
        volume?: string(name='volume', description='This parameter is required.', example='1'),
      }
    ](name='gradeVolumes'),
    textbookVersion?: string(name='textbookVersion', description='This parameter is required.', example='人教版'),
  }(name='data'),
  errCode?: string(name='errCode', example='0'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='F3B1AAF2-3041-5AA7-A352-BD5F998FA465'),
  success?: boolean(name='success', example='true'),
}

model ListTextbookAssistantGradeVolumesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTextbookAssistantGradeVolumesResponseBody(name='body'),
}

/**
 * @summary 获取有资源的年级信息
 *
 * @param request ListTextbookAssistantGradeVolumesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTextbookAssistantGradeVolumesResponse
 */
async function listTextbookAssistantGradeVolumesWithOptions(request: ListTextbookAssistantGradeVolumesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTextbookAssistantGradeVolumesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTextbookAssistantGradeVolumes',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/teachingResource/ListGradeVolumes`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取有资源的年级信息
 *
 * @param request ListTextbookAssistantGradeVolumesRequest
 * @return ListTextbookAssistantGradeVolumesResponse
 */
async function listTextbookAssistantGradeVolumes(request: ListTextbookAssistantGradeVolumesRequest): ListTextbookAssistantGradeVolumesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTextbookAssistantGradeVolumesWithOptions(request, headers, runtime);
}

model ListTextbookAssistantSceneDetailsRequest {
  authToken?: string(name='authToken', example='tc_e6dc70c890866f4028ca685b6fa29874'),
  sceneIdList?: [ string ](name='sceneIdList'),
}

model ListTextbookAssistantSceneDetailsResponseBody = {
  data?: [ 
    {
      roleList?: [ 
        {
          introduction?: string(name='introduction', example='Carl, a curious boy'),
          introductionTranslate?: string(name='introductionTranslate'),
          promoting?: string(name='promoting', example='Hi Noah, who is that in the photo?'),
          promotingTranslate?: string(name='promotingTranslate'),
          roleName?: string(name='roleName', example='Carl'),
          roleNameTranslate?: string(name='roleNameTranslate', example='Carl'),
          roleType?: string(name='roleType', example='0'),
        }
      ](name='roleList'),
      scene?: string(name='scene', example='At school, Carl sees a photo and asks you about your family.'),
      sceneId?: string(name='sceneId', example='38c41b7b509911efbe6e0c42a106bb02'),
      sceneImageList?: [ string ](name='sceneImageList'),
      sceneTaskList?: [ 
        {
          sceneTask?: string(name='sceneTask', example='Say that this is your dad\\\\"s brother.'),
          sceneTaskTranslate?: string(name='sceneTaskTranslate'),
        }
      ](name='sceneTaskList'),
      sentenceList?: [ 
        {
          sentenceAnalysis?: string(name='sentenceAnalysis'),
          sentenceId?: string(name='sentenceId', example='a774c6d09c4511eebe6e0c42a106bb02'),
          sentenceText?: string(name='sentenceText', example='Is this your sister?'),
        }
      ](name='sentenceList'),
      target?: string(name='target', example='""'),
      theme?: {
        themeImageList?: [ string ](name='themeImageList'),
        themeName?: string(name='themeName'),
        themeTranslate?: string(name='themeTranslate', example='Family and family life'),
      }(name='theme'),
      topic?: {
        topicImageList?: [ string ](name='topicImageList'),
        topicName?: string(name='topicName'),
        topicTranslate?: string(name='topicTranslate', example='Introducing family members'),
      }(name='topic'),
      wordList?: [ 
        {
          wordAnalysis?: string(name='wordAnalysis'),
          wordId?: string(name='wordId', example='a94c3337ed8c11eebe6e0c42a106bb02'),
          wordText?: string(name='wordText', example='family'),
        }
      ](name='wordList'),
    }
  ](name='data'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model ListTextbookAssistantSceneDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTextbookAssistantSceneDetailsResponseBody(name='body'),
}

/**
 * @summary 获取文章内容详情
 *
 * @param request ListTextbookAssistantSceneDetailsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTextbookAssistantSceneDetailsResponse
 */
async function listTextbookAssistantSceneDetailsWithOptions(request: ListTextbookAssistantSceneDetailsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTextbookAssistantSceneDetailsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authToken)) {
    body['authToken'] = request.authToken;
  }
  if (!Util.isUnset(request.sceneIdList)) {
    body['sceneIdList'] = request.sceneIdList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTextbookAssistantSceneDetails',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/textbookAssistant/teachingResource/ListSceneDetails`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取文章内容详情
 *
 * @param request ListTextbookAssistantSceneDetailsRequest
 * @return ListTextbookAssistantSceneDetailsResponse
 */
async function listTextbookAssistantSceneDetails(request: ListTextbookAssistantSceneDetailsRequest): ListTextbookAssistantSceneDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTextbookAssistantSceneDetailsWithOptions(request, headers, runtime);
}

model PersonalizedTextToImageAddInferenceJobRequest {
  imageNumber?: int32(name='imageNumber', example='1'),
  imageUrl?: [ string ](name='imageUrl', description='This parameter is required.'),
  prompt?: string(name='prompt', description='This parameter is required.', example='a <special-token> in the snow'),
  seed?: long(name='seed', example='1'),
  strength?: double(name='strength', example='1'),
  trainSteps?: int32(name='trainSteps', example='800'),
}

model PersonalizedTextToImageAddInferenceJobResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2023-12-25T12:00:00'),
    id?: string(name='id', example='3220'),
    jobStatus?: string(name='jobStatus', example='FINISHED'),
    jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
    modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
    promptId?: string(name='promptId', description='promptId', example='promptId-xxxx-xxxx-xxxx'),
    resultImageUrl?: [ string ](name='resultImageUrl', example='0000.png'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model PersonalizedTextToImageAddInferenceJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PersonalizedTextToImageAddInferenceJobResponseBody(name='body'),
}

/**
 * @summary 个性化文生图/基于一个预训练模型创建图片推理任务
 *
 * @param request PersonalizedTextToImageAddInferenceJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PersonalizedTextToImageAddInferenceJobResponse
 */
async function personalizedTextToImageAddInferenceJobWithOptions(request: PersonalizedTextToImageAddInferenceJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PersonalizedTextToImageAddInferenceJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageNumber)) {
    body['imageNumber'] = request.imageNumber;
  }
  if (!Util.isUnset(request.imageUrl)) {
    body['imageUrl'] = request.imageUrl;
  }
  if (!Util.isUnset(request.prompt)) {
    body['prompt'] = request.prompt;
  }
  if (!Util.isUnset(request.seed)) {
    body['seed'] = request.seed;
  }
  if (!Util.isUnset(request.strength)) {
    body['strength'] = request.strength;
  }
  if (!Util.isUnset(request.trainSteps)) {
    body['trainSteps'] = request.trainSteps;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PersonalizedTextToImageAddInferenceJob',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/addPreModelInferenceJob`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/基于一个预训练模型创建图片推理任务
 *
 * @param request PersonalizedTextToImageAddInferenceJobRequest
 * @return PersonalizedTextToImageAddInferenceJobResponse
 */
async function personalizedTextToImageAddInferenceJob(request: PersonalizedTextToImageAddInferenceJobRequest): PersonalizedTextToImageAddInferenceJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedTextToImageAddInferenceJobWithOptions(request, headers, runtime);
}

model PersonalizedTextToImageQueryImageAssetRequest {
  encodeFormat?: string(name='encodeFormat', example='base64'),
  imageId?: string(name='imageId', description='This parameter is required.', example='0000.png'),
}

model PersonalizedTextToImageQueryImageAssetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: any(name='body'),
}

/**
 * @summary 个性化文生图/通过唯一的图片编号获取图片内容
 *
 * @param request PersonalizedTextToImageQueryImageAssetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PersonalizedTextToImageQueryImageAssetResponse
 */
async function personalizedTextToImageQueryImageAssetWithOptions(request: PersonalizedTextToImageQueryImageAssetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PersonalizedTextToImageQueryImageAssetResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.encodeFormat)) {
    query['encodeFormat'] = request.encodeFormat;
  }
  if (!Util.isUnset(request.imageId)) {
    query['imageId'] = request.imageId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PersonalizedTextToImageQueryImageAsset',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/queryImageAssetFromImageId`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'any',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/通过唯一的图片编号获取图片内容
 *
 * @param request PersonalizedTextToImageQueryImageAssetRequest
 * @return PersonalizedTextToImageQueryImageAssetResponse
 */
async function personalizedTextToImageQueryImageAsset(request: PersonalizedTextToImageQueryImageAssetRequest): PersonalizedTextToImageQueryImageAssetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedTextToImageQueryImageAssetWithOptions(request, headers, runtime);
}

model PersonalizedTextToImageQueryPreModelInferenceJobInfoRequest {
  inferenceJobId?: string(name='inferenceJobId', description='This parameter is required.', example='girl-xxxx-xxxx-xxxx-xxxx'),
}

model PersonalizedTextToImageQueryPreModelInferenceJobInfoResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2023-12-25T12:00:00'),
    id?: string(name='id', example='3220'),
    jobStatus?: string(name='jobStatus', example='FINISHED'),
    jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
    modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
    promptId?: string(name='promptId', description='promptId', example='promptId-xxxx-xxxx-xxxx'),
    resultImageUrl?: [ string ](name='resultImageUrl', example='0000.png'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model PersonalizedTextToImageQueryPreModelInferenceJobInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PersonalizedTextToImageQueryPreModelInferenceJobInfoResponseBody(name='body'),
}

/**
 * @summary 个性化文生图/查询预制模型推理任务的状态
 *
 * @param request PersonalizedTextToImageQueryPreModelInferenceJobInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PersonalizedTextToImageQueryPreModelInferenceJobInfoResponse
 */
async function personalizedTextToImageQueryPreModelInferenceJobInfoWithOptions(request: PersonalizedTextToImageQueryPreModelInferenceJobInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PersonalizedTextToImageQueryPreModelInferenceJobInfoResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.inferenceJobId)) {
    query['inferenceJobId'] = request.inferenceJobId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PersonalizedTextToImageQueryPreModelInferenceJobInfo',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/queryPreModelInferenceJobInfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/查询预制模型推理任务的状态
 *
 * @param request PersonalizedTextToImageQueryPreModelInferenceJobInfoRequest
 * @return PersonalizedTextToImageQueryPreModelInferenceJobInfoResponse
 */
async function personalizedTextToImageQueryPreModelInferenceJobInfo(request: PersonalizedTextToImageQueryPreModelInferenceJobInfoRequest): PersonalizedTextToImageQueryPreModelInferenceJobInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedTextToImageQueryPreModelInferenceJobInfoWithOptions(request, headers, runtime);
}

model Personalizedtxt2imgAddInferenceJobRequest {
  imageNumber?: int32(name='imageNumber', example='1'),
  modelId?: string(name='modelId', description='This parameter is required.', example='xxxx-xxxx-xxxx'),
  prompt?: string(name='prompt', description='This parameter is required.', example='a <special-token> in the snow'),
  seed?: long(name='seed', example='1'),
}

model Personalizedtxt2imgAddInferenceJobResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2023-12-25T12:00:00'),
    id?: string(name='id', example='3220'),
    jobStatus?: string(name='jobStatus', example='FINISHED'),
    jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
    modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
    promptId?: string(name='promptId', example='promptId-xxxx-xxxx-xxxx'),
    resultImageUrl?: [ string ](name='resultImageUrl', example='0000.png'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model Personalizedtxt2imgAddInferenceJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Personalizedtxt2imgAddInferenceJobResponseBody(name='body'),
}

/**
 * @summary 个性化文生图/基于一个模型创建图片推理任务
 *
 * @param request Personalizedtxt2imgAddInferenceJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return Personalizedtxt2imgAddInferenceJobResponse
 */
async function personalizedtxt2imgAddInferenceJobWithOptions(request: Personalizedtxt2imgAddInferenceJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): Personalizedtxt2imgAddInferenceJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageNumber)) {
    body['imageNumber'] = request.imageNumber;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.prompt)) {
    body['prompt'] = request.prompt;
  }
  if (!Util.isUnset(request.seed)) {
    body['seed'] = request.seed;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Personalizedtxt2imgAddInferenceJob',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/addInferenceJob`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/基于一个模型创建图片推理任务
 *
 * @param request Personalizedtxt2imgAddInferenceJobRequest
 * @return Personalizedtxt2imgAddInferenceJobResponse
 */
async function personalizedtxt2imgAddInferenceJob(request: Personalizedtxt2imgAddInferenceJobRequest): Personalizedtxt2imgAddInferenceJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedtxt2imgAddInferenceJobWithOptions(request, headers, runtime);
}

model Personalizedtxt2imgAddModelTrainJobRequest {
  imageUrl?: [ string ](name='imageUrl', description='This parameter is required.'),
  name?: string(name='name', description='This parameter is required.', example='熊猫图片生成'),
  objectType?: string(name='objectType', description='This parameter is required.', example='dog'),
  trainSteps?: int32(name='trainSteps', example='800'),
}

model Personalizedtxt2imgAddModelTrainJobResponseBody = {
  data?: {
    createTime?: string(name='createTime'),
    id?: string(name='id', example='456'),
    imageUrl?: [ string ](name='imageUrl'),
    inferenceImageCount?: int32(name='inferenceImageCount'),
    inferenceJobList?: [ 
      {
        createTime?: string(name='createTime', example='2023-12-25T12:00:00'),
        id?: string(name='id', example='3220'),
        jobStatus?: string(name='jobStatus', example='FINISHED'),
        jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
        modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
        promptId?: string(name='promptId', example='promptId-xxxx-xxxx-xxxx'),
        resultImageUrl?: [ string ](name='resultImageUrl', example='0000.png'),
      }
    ](name='inferenceJobList'),
    jobStatus?: string(name='jobStatus', example='TRAINING'),
    jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
    modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
    name?: string(name='name', example='可爱熊猫模型训练任务'),
    objectType?: string(name='objectType', example='panda'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model Personalizedtxt2imgAddModelTrainJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Personalizedtxt2imgAddModelTrainJobResponseBody(name='body'),
}

/**
 * @summary 个性化文生图/创建一个模型训练任务
 *
 * @param request Personalizedtxt2imgAddModelTrainJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return Personalizedtxt2imgAddModelTrainJobResponse
 */
async function personalizedtxt2imgAddModelTrainJobWithOptions(request: Personalizedtxt2imgAddModelTrainJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): Personalizedtxt2imgAddModelTrainJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.imageUrl)) {
    body['imageUrl'] = request.imageUrl;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.objectType)) {
    body['objectType'] = request.objectType;
  }
  if (!Util.isUnset(request.trainSteps)) {
    body['trainSteps'] = request.trainSteps;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Personalizedtxt2imgAddModelTrainJob',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/addModelTrainJob`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/创建一个模型训练任务
 *
 * @param request Personalizedtxt2imgAddModelTrainJobRequest
 * @return Personalizedtxt2imgAddModelTrainJobResponse
 */
async function personalizedtxt2imgAddModelTrainJob(request: Personalizedtxt2imgAddModelTrainJobRequest): Personalizedtxt2imgAddModelTrainJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedtxt2imgAddModelTrainJobWithOptions(request, headers, runtime);
}

model Personalizedtxt2imgQueryImageAssetRequest {
  encodeFormat?: string(name='encodeFormat', example='base64'),
  imageId?: string(name='imageId', description='This parameter is required.', example='0000.png'),
  modelId?: string(name='modelId', description='This parameter is required.', example='girl-xxxx-xxxx-xxxx-xxxx'),
  promptId?: string(name='promptId', description='This parameter is required.', example='xxxx-xxxx-xxxx-xxxx'),
}

model Personalizedtxt2imgQueryImageAssetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: any(name='body'),
}

/**
 * @summary 个性化文生图/图片二进制内容获取
 *
 * @param request Personalizedtxt2imgQueryImageAssetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return Personalizedtxt2imgQueryImageAssetResponse
 */
async function personalizedtxt2imgQueryImageAssetWithOptions(request: Personalizedtxt2imgQueryImageAssetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): Personalizedtxt2imgQueryImageAssetResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.encodeFormat)) {
    query['encodeFormat'] = request.encodeFormat;
  }
  if (!Util.isUnset(request.imageId)) {
    query['imageId'] = request.imageId;
  }
  if (!Util.isUnset(request.modelId)) {
    query['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.promptId)) {
    query['promptId'] = request.promptId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Personalizedtxt2imgQueryImageAsset',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/queryImageAsset`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'any',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/图片二进制内容获取
 *
 * @param request Personalizedtxt2imgQueryImageAssetRequest
 * @return Personalizedtxt2imgQueryImageAssetResponse
 */
async function personalizedtxt2imgQueryImageAsset(request: Personalizedtxt2imgQueryImageAssetRequest): Personalizedtxt2imgQueryImageAssetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedtxt2imgQueryImageAssetWithOptions(request, headers, runtime);
}

model Personalizedtxt2imgQueryInferenceJobInfoRequest {
  inferenceJobId?: string(name='inferenceJobId', description='This parameter is required.', example='180'),
}

model Personalizedtxt2imgQueryInferenceJobInfoResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2023-12-25T12:00:00'),
    id?: string(name='id', example='3220'),
    jobStatus?: string(name='jobStatus', example='FINISHED'),
    jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
    modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
    promptId?: string(name='promptId', example='promptId-xxxx-xxxx-xxxx'),
    resultImageUrl?: [ string ](name='resultImageUrl', example='0000.png'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model Personalizedtxt2imgQueryInferenceJobInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Personalizedtxt2imgQueryInferenceJobInfoResponseBody(name='body'),
}

/**
 * @summary 个性化文生图/查询模型推理任务的状态和结果信息
 *
 * @param request Personalizedtxt2imgQueryInferenceJobInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return Personalizedtxt2imgQueryInferenceJobInfoResponse
 */
async function personalizedtxt2imgQueryInferenceJobInfoWithOptions(request: Personalizedtxt2imgQueryInferenceJobInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): Personalizedtxt2imgQueryInferenceJobInfoResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.inferenceJobId)) {
    query['inferenceJobId'] = request.inferenceJobId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Personalizedtxt2imgQueryInferenceJobInfo',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/queryInferenceJobInfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/查询模型推理任务的状态和结果信息
 *
 * @param request Personalizedtxt2imgQueryInferenceJobInfoRequest
 * @return Personalizedtxt2imgQueryInferenceJobInfoResponse
 */
async function personalizedtxt2imgQueryInferenceJobInfo(request: Personalizedtxt2imgQueryInferenceJobInfoRequest): Personalizedtxt2imgQueryInferenceJobInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedtxt2imgQueryInferenceJobInfoWithOptions(request, headers, runtime);
}

model Personalizedtxt2imgQueryModelTrainJobListResponseBody = {
  data?: [ 
    {
      createTime?: string(name='createTime'),
      id?: string(name='id', example='456'),
      imageUrl?: [ string ](name='imageUrl'),
      inferenceImageCount?: int32(name='inferenceImageCount'),
      inferenceJobList?: [ 
        {
          createTime?: string(name='createTime', example='2023-12-25T12:00:00'),
          id?: string(name='id', example='3220'),
          jobStatus?: string(name='jobStatus', example='FINISHED'),
          jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
          modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
          promptId?: string(name='promptId', example='promptId-xxxx-xxxx-xxxx'),
          resultImageUrl?: [ string ](name='resultImageUrl', example='0000.png'),
        }
      ](name='inferenceJobList'),
      jobStatus?: string(name='jobStatus', example='TRAINING'),
      jobTrainProgress?: double(name='jobTrainProgress', example='0.5'),
      modelId?: string(name='modelId', example='modelId-xxxx-xxxx-xxxx'),
      name?: string(name='name', example='可爱熊猫模型训练任务'),
      objectType?: string(name='objectType', example='panda'),
    }
  ](name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model Personalizedtxt2imgQueryModelTrainJobListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Personalizedtxt2imgQueryModelTrainJobListResponseBody(name='body'),
}

/**
 * @summary 个性化文生图/查询模型训练任务列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return Personalizedtxt2imgQueryModelTrainJobListResponse
 */
async function personalizedtxt2imgQueryModelTrainJobListWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): Personalizedtxt2imgQueryModelTrainJobListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'Personalizedtxt2imgQueryModelTrainJobList',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/queryModelTrainJobList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/查询模型训练任务列表
 *
 * @return Personalizedtxt2imgQueryModelTrainJobListResponse
 */
async function personalizedtxt2imgQueryModelTrainJobList(): Personalizedtxt2imgQueryModelTrainJobListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedtxt2imgQueryModelTrainJobListWithOptions(headers, runtime);
}

model Personalizedtxt2imgQueryModelTrainStatusRequest {
  modelId?: string(name='modelId', description='This parameter is required.', example='modelId-xxxx-xxxx-xxxx'),
}

model Personalizedtxt2imgQueryModelTrainStatusResponseBody = {
  data?: {
    modelTrainStatus?: string(name='modelTrainStatus', example='FINISHED'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model Personalizedtxt2imgQueryModelTrainStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Personalizedtxt2imgQueryModelTrainStatusResponseBody(name='body'),
}

/**
 * @summary 个性化文生图/模型训练状态查询
 *
 * @param request Personalizedtxt2imgQueryModelTrainStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return Personalizedtxt2imgQueryModelTrainStatusResponse
 */
async function personalizedtxt2imgQueryModelTrainStatusWithOptions(request: Personalizedtxt2imgQueryModelTrainStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): Personalizedtxt2imgQueryModelTrainStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.modelId)) {
    query['modelId'] = request.modelId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Personalizedtxt2imgQueryModelTrainStatus',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/personalizedtxt2img/queryModelTrainStatus`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 个性化文生图/模型训练状态查询
 *
 * @param request Personalizedtxt2imgQueryModelTrainStatusRequest
 * @return Personalizedtxt2imgQueryModelTrainStatusResponse
 */
async function personalizedtxt2imgQueryModelTrainStatus(request: Personalizedtxt2imgQueryModelTrainStatusRequest): Personalizedtxt2imgQueryModelTrainStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return personalizedtxt2imgQueryModelTrainStatusWithOptions(request, headers, runtime);
}

model QueryApplicationAccessIdRequest {
  applicationAccessId?: string(name='applicationAccessId', example='1234567890'),
}

model QueryApplicationAccessIdResponseBody = {
  data?: {
    applicationAccessId?: string(name='applicationAccessId', example='1234567890'),
    applicationAccessSecret?: string(name='applicationAccessSecret', example='MyAppSecret'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model QueryApplicationAccessIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryApplicationAccessIdResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/获取应用访问识别码(appkey)信息
 *
 * @param request QueryApplicationAccessIdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryApplicationAccessIdResponse
 */
async function queryApplicationAccessIdWithOptions(request: QueryApplicationAccessIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryApplicationAccessIdResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.applicationAccessId)) {
    query['applicationAccessId'] = request.applicationAccessId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryApplicationAccessId',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/queryApplicationAccessId`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/获取应用访问识别码(appkey)信息
 *
 * @param request QueryApplicationAccessIdRequest
 * @return QueryApplicationAccessIdResponse
 */
async function queryApplicationAccessId(request: QueryApplicationAccessIdRequest): QueryApplicationAccessIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryApplicationAccessIdWithOptions(request, headers, runtime);
}

model QueryProjectRequest {
  projectId?: string(name='projectId', example='123'),
}

model QueryProjectResponseBody = {
  data?: {
    createTime?: string(name='CreateTime', example='2024-11-01T13:40:53Z'),
    projectApps?: [ 
      {
        applicationAccessIds?: [ 
          {
            applicationAccessId?: string(name='applicationAccessId', example='1234567890'),
            applicationAccessSecret?: string(name='applicationAccessSecret', example='MyAppSecret'),
          }
        ](name='ApplicationAccessIds'),
        id?: string(name='Id', example='2144'),
        projectId?: string(name='ProjectId', example='159'),
      }
    ](name='ProjectApps'),
    projectId?: string(name='ProjectId', example='67055'),
    projectName?: string(name='ProjectName', example='MyProject'),
    projectSDK?: [ 
      {
        createTime?: string(name='CreateTime', example='2024-11-01T13:40:53Z'),
        demoUrl?: string(name='DemoUrl', example='http://demo.com/demo'),
        deployMode?: string(name='DeployMode'),
        developLanguage?: string(name='DevelopLanguage', example='JAVA'),
        docUrl?: string(name='DocUrl', example='http://demo.com/doc'),
        sdkName?: string(name='SdkName', example='JSSDK'),
        sdkUrl?: string(name='SdkUrl', example='http://demo.com/sdk.zip'),
        sdkVersion?: string(name='SdkVersion', example='5.1.0'),
      }
    ](name='ProjectSDK'),
    projectType?: string(name='ProjectType', example='WebApplication'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model QueryProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryProjectResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/获取项目列表
 *
 * @param request QueryProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryProjectResponse
 */
async function queryProjectWithOptions(request: QueryProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryProjectResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.projectId)) {
    query['projectId'] = request.projectId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryProject',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/queryProject`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/获取项目列表
 *
 * @param request QueryProjectRequest
 * @return QueryProjectResponse
 */
async function queryProject(request: QueryProjectRequest): QueryProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryProjectWithOptions(request, headers, runtime);
}

model QueryProjectListResponseBody = {
  data?: [ 
    {
      createTime?: string(name='CreateTime', example='2025-02-18 12:10:22'),
      projectApps?: [ 
        {
          applicationAccessIds?: [ 
            {
              applicationAccessId?: string(name='applicationAccessId', example='1234567890'),
              applicationAccessSecret?: string(name='applicationAccessSecret', example='MyAppSecret'),
            }
          ](name='ApplicationAccessIds'),
          id?: string(name='Id', example='4700'),
          projectId?: string(name='ProjectId', example='4747'),
        }
      ](name='ProjectApps'),
      projectId?: string(name='ProjectId', example='4910'),
      projectName?: string(name='ProjectName', example='MyProject'),
      projectSDK?: [ 
        {
          createTime?: string(name='CreateTime', example='2024-07-16T08:23:19Z'),
          demoUrl?: string(name='DemoUrl', example='http://demo.com/demo'),
          deployMode?: string(name='DeployMode'),
          developLanguage?: string(name='DevelopLanguage', example='JAVA'),
          docUrl?: string(name='DocUrl', example='http://demo.com/doc'),
          sdkName?: string(name='SdkName', example='GO AUTH'),
          sdkUrl?: string(name='SdkUrl', example='http://demo.com/sdk.zip'),
          sdkVersion?: string(name='SdkVersion', example='.3.52'),
        }
      ](name='ProjectSDK'),
      projectType?: string(name='ProjectType', example='WebApplication'),
    }
  ](name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model QueryProjectListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryProjectListResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/获取项目列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryProjectListResponse
 */
async function queryProjectListWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): QueryProjectListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'QueryProjectList',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/queryProjectList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/获取项目列表
 *
 * @return QueryProjectListResponse
 */
async function queryProjectList(): QueryProjectListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryProjectListWithOptions(headers, runtime);
}

model QueryPurchasedServiceResponseBody = {
  data?: [
    AliyunConsoleServiceInfoDTO
  ](name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model QueryPurchasedServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPurchasedServiceResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/已经购买过的服务项目
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPurchasedServiceResponse
 */
async function queryPurchasedServiceWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): QueryPurchasedServiceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'QueryPurchasedService',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/queryPurchasedService`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/已经购买过的服务项目
 *
 * @return QueryPurchasedServiceResponse
 */
async function queryPurchasedService(): QueryPurchasedServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryPurchasedServiceWithOptions(headers, runtime);
}

model UpdateProjectRequest {
  projectId?: string(name='projectId', example='123'),
  projectName?: string(name='projectName', example='MyProject'),
}

model UpdateProjectResponseBody = {
  data?: {
    createTime?: string(name='CreateTime', example='2024-12-10T02:07:16Z'),
    projectApps?: [ 
      {
        applicationAccessIds?: [ 
          {
            applicationAccessId?: string(name='applicationAccessId', example='1234567890'),
            applicationAccessSecret?: string(name='applicationAccessSecret', example='MyAppSecret'),
          }
        ](name='ApplicationAccessIds'),
        id?: string(name='Id', example='4498'),
        projectId?: string(name='ProjectId', example='1889'),
      }
    ](name='ProjectApps'),
    projectId?: string(name='ProjectId', example='56160'),
    projectName?: string(name='ProjectName', example='MyProject'),
    projectSDK?: [ 
      {
        createTime?: string(name='CreateTime', example='2024-11-01T13:40:53Z'),
        demoUrl?: string(name='DemoUrl', example='http://demo.com/demo'),
        deployMode?: string(name='DeployMode'),
        developLanguage?: string(name='DevelopLanguage', example='PHP'),
        docUrl?: string(name='DocUrl', example='http://demo.com/doc'),
        sdkName?: string(name='SdkName'),
        sdkUrl?: string(name='SdkUrl', example='http://demo.com/sdk.zip'),
        sdkVersion?: string(name='SdkVersion', example='4.13.0'),
      }
    ](name='ProjectSDK'),
    projectType?: string(name='ProjectType', example='WebApplication'),
  }(name='data', example='[]'),
  errCode?: string(name='errCode', example='UNKNOWN_ERROR'),
  errMessage?: string(name='errMessage', example='未知错误'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  requestId?: string(name='requestId', example='xxxx-xxxx-xxxx-xxxxxxxx'),
  success?: boolean(name='success', example='true'),
}

model UpdateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectResponseBody(name='body'),
}

/**
 * @summary 阿里云控制台/更新项目信息
 *
 * @param request UpdateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectResponse
 */
async function updateProjectWithOptions(request: UpdateProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.projectId)) {
    body['projectId'] = request.projectId;
  }
  if (!Util.isUnset(request.projectName)) {
    body['projectName'] = request.projectName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProject',
    version = '20240611',
    protocol = 'HTTPS',
    pathname = `/api/v1/aliyunConsole/updateProject`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 阿里云控制台/更新项目信息
 *
 * @param request UpdateProjectRequest
 * @return UpdateProjectResponse
 */
async function updateProject(request: UpdateProjectRequest): UpdateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectWithOptions(request, headers, runtime);
}

